-
-
Couldn't load subscription status.
- Fork 1.7k
ref(node): Partially remove dynamic require calls
#7377
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
Conversation
b24e5d5 to
d239f13
Compare
| this._session.post('Debugger.enable'); | ||
| // We only want to pause on uncaught exceptions | ||
| this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); | ||
| this._inspectorModulePromise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more elegant/"safe" than throwing in the constructor anyhow to me 👍
d076231 to
ef38b72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, this is actually much better!
require callsrequire calls
require callsrequire calls
…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 :(
This PR removes a few dynamic
requirecalls from our Node SDK in favour of making them top-level imports.Httpintegration:httpandhttpsare now top-level imports.https-proxy-agentis now a top-level import as v5 no longer produces side effects when importing.We need this change for the SvelteKit SDK, as SvelteKit doesn't accept
requirecalls in server code by default.ref #7348 #6692