-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix http
monkeypatching for Node 18.15 introduced in v7.42.0
#7425
Comments
This has also been reproduced in one of the Electron SDK e2e tests that uses Rollup for the node process code: Looks like this is caused by #7377 + strict mode + bundled into a single file. |
Cannot assign to read only property 'get' of object '[object Module]'
on Node 18.15 and SDK v7.42.0http
monkeypatching for Node 18.15 introduced in v7.42.0
Hi @dotansimha thanks for reporting! I'll take a look at this. Ideally we can find a solution that doesn't require (pun intended) us to switch back to |
@dotansimha: We've opened a PR (#7430) to partially revert #7377. In my reproduction (which I initially got to fail with the same error you reported), everything seems to work now again. Would you nevertheless mind sharing a little bit about your project setup? I'm assuming you're using a bundler, right? If yes, please share your config and how you're setting your bundler up. Are you transpiling to CJS? |
…7430) Partially revert #7377 which caused monkey patching errors when patching the native `http` and `https` modules in the Node SDK (#7425). Similarly, also our Serverless SDK was subjected to the same problem (#7421). The problem is that `import` doesn't permit monkey patching of the imported (`http(s)`) module, producing this error: ```bash TypeError: Cannot assign to read only property 'get' of object '[object Module]' ``` I tried using a dynamic import instead but got the same result. So it seems like we can only use `require` here :(
That's great, thank you for the quick response on this one! Can't wait for the release to test it :)
Sure. We are using a custom tool (https://github.com/kamilkisiela/bob) that wraps I'll ask our team to share a bit more information here soon! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g.
bundle.tracing.min.js
) in your SDK setup.@sentry/node
SDK Version
7.42.0
Framework Version
Node 18.15
Link to Sentry event
No response
SDK Setup
Nothing too fancy. Just a regular setup with defaults:
Steps to Reproduce
Since upgraded to
v7.42.0
along with Node 18.15, I get this error when my server starts:And this line is found in:
https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/integrations/http.ts#L105
It seems like a recent PR was touching these code areas? #7377
Reverting back to
7.41.0
seems to work perfectly fine.Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: