-
-
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
ref(node): Partially remove dynamic require
calls
#7377
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lms24
force-pushed
the
lms/remove-dynamic-requires
branch
from
March 8, 2023 12:08
b24e5d5
to
d239f13
Compare
mydea
reviewed
Mar 8, 2023
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 👍
mydea
reviewed
Mar 8, 2023
Lms24
force-pushed
the
lms/remove-dynamic-requires
branch
from
March 8, 2023 14:24
d076231
to
ef38b72
Compare
mydea
approved these changes
Mar 8, 2023
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!
Lms24
changed the title
ref(node): Remove
ref(node): Partially remove Mar 8, 2023
require
callsrequire
calls
Lms24
changed the title
ref(node): Partially remove
ref(node): Partially remove dynamic Mar 8, 2023
require
callsrequire
calls
3 tasks
This was referenced Mar 13, 2023
Closed
Lms24
added a commit
that referenced
this pull request
Mar 13, 2023
…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 :(
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes a few dynamic
require
calls from our Node SDK in favour of making them top-level imports.Http
integration:http
andhttps
are now top-level imports.https-proxy-agent
is 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
require
calls in server code by default.ref #7348 #6692