-
Notifications
You must be signed in to change notification settings - Fork 227
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: fix sourcemap errors with node v18 #2596
Conversation
Recent node v18 turned on an implementation of `fetch()` by default. The 'source-map@0.7.3' dep used for sourcemap handling incorrectly uses the presence of `fetch` to decide it is in a browser env. This change inlines the load-source-map dep so we can update it to use the *beta* source-map@0.8.0-beta.0 which includes a fix. Fixes: #2589
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.
Interesting -- I was under the impression that fetch would still need a --experimental-fetch
to run in Node 18. I wonder if that's an oversight in a pre-release build or a signal to a chance of plans.
Regardless -- I see in this PR we've downloaded a local copy of load-source-map
at version 2.0.0 that's identical to the load-source-map
distribution. This module has source-map
as a dependency.
Then we've updated the version of the source-map
package we're using to 0.8.0-beta.0
in order to force our local copy of load-source-map
to use this version of source-map
.
FWIW, I did a quick check and tried using the following combination in package.json
"source-map": "0.8.0-beta.0",
"load-source-map": "^2.0.0",
and NPM appeared to do the right thing -- but I presume the approach in this PR gives us a little more certainty and control. Approving.
It is intentional: nodejs/node#41811
That doesn't work for what we need:
In this case |
FYI: |
Recent node v18 turned on an implementation of
fetch()
by default.The 'source-map@0.7.3' dep used for sourcemap handling incorrectly
uses the presence of
fetch
to decide it is in a browser env.This change inlines the load-source-map dep so we can update it to
use the beta source-map@0.8.0-beta.0 which includes a fix.
Fixes: #2589