Skip to content
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

chore: adding 'no-experimental-fetch' node option by default #25628

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Oct 12, 2023

SUMMARY

When running npm run build I would get this error:

throw new Error("You must provide the URL of lib/mappings.wasm by calling " +
            ^

Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (/Users/evan/GitHub/superset/superset-frontend/node_modules/react-hot-loader/node_modules/source-map/lib/read-wasm.js:8:13)
    at wasm (/Users/evan/GitHub/superset/superset-frontend/node_modules/react-hot-loader/node_modules/source-map/lib/wasm.js:25:16)
    at /Users/evan/GitHub/superset/superset-frontend/node_modules/react-hot-loader/node_modules/source-map/lib/source-map-consumer.js:264:14

Node.js v18.16.1

When troubleshooting, I found a helpful note in the docs:

If this type of error comes while building assets(i.e using above commands):

Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize

Then put this:

export NODE_OPTIONS=--no-experimental-fetch

I'm assuming that nobody needs the experimental-fetch option enabled, so rather than letting users hit this error and go looking for the fix, let's just add the fix to the webpack build scripts in package.json

Updated approach! Upon fiddling with things, it seems that simply installing the source-map dependency seems to automagically provide the missing mappings.wasm file, and we no longer have a problem.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

n/a

TESTING INSTRUCTIONS

run all three build methods and make sure they don't bomb out :)

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas rusackas changed the title chore: adding 'no-experimental-fetch' node option on scripts, removin… chore: adding 'no-experimental-fetch' node option by default Oct 12, 2023
@rusackas
Copy link
Member Author

@mdeshmu since you added the docs (thank you!!!) let me know if I'm missing something here... I assume this would just fix it, but let us know if you think this PR sets up some other danger/error.

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e1d73d5) 69.07% compared to head (27993f6) 69.05%.
Report is 84 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #25628      +/-   ##
==========================================
- Coverage   69.07%   69.05%   -0.03%     
==========================================
  Files        1939     1945       +6     
  Lines       75866    78089    +2223     
  Branches     8432     8988     +556     
==========================================
+ Hits        52406    53922    +1516     
- Misses      21285    21847     +562     
- Partials     2175     2320     +145     
Flag Coverage Δ
hive 53.66% <ø> (ø)
javascript 56.83% <ø> (+0.58%) ⬆️
mysql 78.16% <ø> (ø)
postgres 78.26% <ø> (ø)
presto 53.61% <ø> (ø)
python 82.91% <ø> (ø)
sqlite 76.91% <ø> (ø)
unit 55.73% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

If this type of error comes while building assets(i.e using above commands):

```bash
Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though i didn't add these docs but I feel calling SourceMapConsumer.initialize would still be needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon messing with it, it seems like you shouldn't have to call the initialize method when using React... and that merely installing the source-map npm module fixes this.

I did unset NODE_OPTIONS to set my machine back to "stock" and all of the webpack build modes seem to work fine now.

@rusackas rusackas marked this pull request as draft October 13, 2023 16:52
@rusackas rusackas marked this pull request as ready for review October 13, 2023 22:06
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rusackas rusackas merged commit 46e6778 into master Dec 12, 2023
51 checks passed
@rusackas rusackas deleted the no-experimental-fetch branch December 12, 2023 21:35
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants