Repository navigation
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.0.0-alpha.4
Framework Version
No response
Link to Sentry event
No response
SDK Setup
N/A
Steps to Reproduce
Load script with node --loader=import-in-the-middle/hook.mjs ./dist/bin/server.js
Gives error:
030292a3 > This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
030292a3 > TypeError: prismaInstrumentation.PrismaInstrumentation is not a constructor
030292a3 > at Object.setupOnce (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+node@8.0.0-alpha.4/node_modules/@sentry/node/esm/index.js:2075:11)
030292a3 > at setupIntegration (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+core@8.0.0-alpha.4/node_modules/@sentry/core/esm/index.js:4927:17)
030292a3 > at file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+core@8.0.0-alpha.4/node_modules/@sentry/core/esm/index.js:4897:7
030292a3 > at Array.forEach (<anonymous>)
030292a3 > at setupIntegrations (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+core@8.0.0-alpha.4/node_modules/@sentry/core/esm/index.js:4894:16)
030292a3 > at NodeClient._setupIntegrations (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+core@8.0.0-alpha.4/node_modules/@sentry/core/esm/index.js:5396:26)
030292a3 > at NodeClient.init (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+core@8.0.0-alpha.4/node_modules/@sentry/core/esm/index.js:5249:12)
030292a3 > at init (file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/@sentry+node@8.0.0-alpha.4/node_modules/@sentry/node/esm/index.js:3104:12)
030292a3 > at createSentry (file:///Users/x/Developer/contra/gaia/packages/sentry/dist/node.js:69:5)
030292a3 > at file:///Users/x/Developer/contra/gaia/apps/contra-api/src/bin/server.ts:1:205
What worked was a dumb patch:
diff --git a/esm/index.js b/esm/index.js
index d9f5c81971e65b60e49a9ae7502c710bb4d2bd9d..bd28c7836c5b9e9075e611a117d80c1d66e7a82a 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -2072,7 +2072,7 @@ const _prismaIntegration = (() => {
registerInstrumentations({
instrumentations: [
// does not have a hook to adjust spans & add origin
- new prismaInstrumentation.PrismaInstrumentation({}),
+ // new prismaInstrumentation.PrismaInstrumentation({}),
],
});
},
All other modules load fine.
Reacted by Danilo Fuchs and Dan Thareja
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
- StatusShow more project fieldsNo status
Activity
AbhiPrasad commentedon Mar 20, 2024
This is prisma/orm#23410 - tracked by #11070.
Known issue that we will resolve before v8 comes out, maybe for now just have to disable prisma instrumentation in ESM builds (basically strip it out).
gajus commentedon Mar 20, 2024
Closing as duplicate. Thanks for the update.
lforst commentedon May 14, 2024
@jnicklas Re your comment #11070 (comment). Are you manually using the
prismaIntegration()with ESM?jnicklas commentedon May 15, 2024
@lforst yes, that's what I'm doing, maybe this is no longer necessary in the new version? This was not mentioned in the upgrade guide, so I'm not sure. I know there are some default integrations, but it's not quite clear which ones those are, and what I actually need to do.
3 remaining items
lilouartz commentedon May 16, 2024
Could not get it to work with Remix ESM.
mydea commentedon May 17, 2024
We'll need to investigate ESM support for this some more. I think there are some fundamental incpompatibilies there, but not 100% sure, cc @timfish and @AbhiPrasad you've looked into this more in the past!
danthareja commentedon May 22, 2024
I had the same issue in an ESM build using
--import ./instrument.js.Versions:
I fixed this with the following patch (applied with with patch-package)