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

You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize #35607

Closed
2 tasks done
benackles opened this issue May 8, 2022 · 15 comments · Fixed by #35621
Closed
2 tasks done
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby type: upstream Issues outside of Gatsby's control, caused by dependencies

Comments

@benackles
Copy link
Contributor

benackles commented May 8, 2022

Preliminary Checks

Please make sure that you verify each checkbox and follow the instructions for them.

Description

I have a new laptop and I am setting up my environment following the Gatsby tutorial.. I am running into issues when I get to the step to "Run your site locally" specifically with the gatsby develop command. I get a webpack error on two files.

I have not made it to the step to make my first commit to my GitHub repo, so the repo linked is the new repo without my initial commit (not a Gatsby site).

Reproduction Link

https://github.com/benackles/whatsgatsby

Steps to Reproduce

  1. Run gatsby develop
  2. Get two ERROR #98123 WEBPACK errors

Expected Result

Successfully fire up locally

Copycopy code to clipboard
You can now view whatsgatsby in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and
schema
⠀
  http://localhost:8000/___graphql

Actual Result

ERROR #98123  WEBPACK

Generating development JavaScript bundle failed

You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({
'lib/mappings.wasm': ... }) before using SourceMapConsumer

File: .cache/app.js


ERROR #98123  WEBPACK

Generating development JavaScript bundle failed

You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({
'lib/mappings.wasm': ... }) before using SourceMapConsumer

File: .cache/polyfill-entry.js

failed Building development bundle - 3.925s
ERROR in ./.cache/app.js
Module build failed (from 
./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js):
Error: You must provide the URL of lib/mappings.wasm by calling 
SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
   at readWasm
(/Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/read-wasm.js:8:13)
   at wasm (/Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/wasm.js:25:16)
   at /Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/source-map-consumer.
js:264:14
   at Object._loader (/Users/benjamins/Sites/whatsgatsby/node_modules/@pmmmwh/react-refre
sh-webpack-plugin/loader/index.js:81:9)

ERROR in ./.cache/polyfill-entry.js
Module build failed (from 
./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js):
Error: You must provide the URL of lib/mappings.wasm by calling 
SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
   at readWasm
(/Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/read-wasm.js:8:13)
   at wasm (/Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/wasm.js:25:16)
   at /Users/benjamins/Sites/whatsgatsby/node_modules/source-map/lib/source-map-consumer.
js:264:14
   at Object._loader (/Users/benjamins/Sites/whatsgatsby/node_modules/@pmmmwh/react-refre
sh-webpack-plugin/loader/index.js:81:9)

develop compiled with 2 errors

Environment

System:
    OS: macOS 12.2.1
    CPU: (8) arm64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.0.0 - /opt/homebrew/bin/node
    npm: 8.9.0 - /opt/homebrew/bin/npm
  Languages:
    Python: 2.7.18 - /usr/bin/python
  Browsers:
    Chrome: 101.0.4951.54
    Safari: 15.3
  npmPackages:
    gatsby: ^4.13.1 => 4.13.1
    gatsby-plugin-gatsby-cloud: ^4.13.0 => 4.13.0
    gatsby-plugin-image: ^2.13.0 => 2.13.0
    gatsby-plugin-manifest: ^4.13.0 => 4.13.0
    gatsby-plugin-offline: ^5.13.0 => 5.13.0
    gatsby-plugin-react-helmet: ^5.13.0 => 5.13.0
    gatsby-plugin-sharp: ^4.13.0 => 4.13.0
    gatsby-source-filesystem: ^4.13.0 => 4.13.0
    gatsby-transformer-sharp: ^4.13.0 => 4.13.0
  npmGlobalPackages:
    gatsby-cli: 4.13.0

Config Flags

No response

@benackles benackles added the type: bug An issue or pull request relating to a bug in Gatsby label May 8, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 8, 2022
@gvorbeck
Copy link

gvorbeck commented May 8, 2022

Been having a very similar error happen any time I make a syntax error like forgetting quotes around a string or missing a required prop on a component. Completely crashes my development server so I'm having to restart it frequently and troubleshooting becomes very difficult and time consuming. I don't understand it and google has not helped.

You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer

@LekoArts LekoArts added type: upstream Issues outside of Gatsby's control, caused by dependencies and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 9, 2022
@LekoArts
Copy link
Contributor

LekoArts commented May 9, 2022

Can you try using Node.js v16? I'm pretty sure it's this issue: mozilla/source-map#454

We'll need to see what we do with this upstream dependency

@LekoArts LekoArts added the status: needs more info Needs triaging and reproducible examples or more information to be resolved label May 9, 2022
@benackles
Copy link
Contributor Author

@LekoArts That did resolve it. New Macs ship with Node.js v18

@yihuajack
Copy link

yihuajack commented May 10, 2022

Moving back to node.js 16 may not be a final solution, see #13713 and nodejs/node#42638. This issue could keep open

@LekoArts
Copy link
Contributor

We'll try to migrate away so that it works also on Node 18

@LekoArts LekoArts reopened this May 10, 2022
@LekoArts LekoArts added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. and removed status: needs more info Needs triaging and reproducible examples or more information to be resolved labels May 10, 2022
@LekoArts LekoArts changed the title Gatsby Develop > ERROR #98123 WEBPACK You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize May 10, 2022
@bre7
Copy link

bre7 commented May 10, 2022

Same as parcel-bundler/parcel#8005 ?

Try forcing resolution "source-map": "^0.8.0-beta.0"

@TheOtterlord
Copy link

Try forcing resolution "source-map": "^0.8.0-beta.0"

This works for the time being on the latest version of Node.js
Thanks

@antoinetielbeke
Copy link

antoinetielbeke commented May 18, 2022

I use node.js v18.0.0, set my package.json to:

  "resolutions": {
    "source-map": "^0.8.0-beta.0"
  },

deleted the node_modules folder and package-lock.json, ran npm install again but I still end up with this error.

Does anyone have any other suggestions?

@TheOtterlord
Copy link

maybe placing it as a dependency?

@antoinetielbeke
Copy link

@TheOtterlord That worked! Thank you.

I added it as a depedency in my package.json file:

  "resolutions": {
    "source-map": "^0.8.0-beta.0"
  },
  "dependencies": {
    "source-map": "^0.8.0-beta.0",
    ...

@gvorbeck
Copy link

if I'm using yarn workspaces to build a theme as described in this Gatsby guide and I'm running into this error, which package.json file should I put this source-map in? The root, the site or the theme?

@TheOtterlord
Copy link

Probably root because it should effect all workspaces. I'm not too familiar with dependency resolution for workspaces though, so they might work differently.

@LekoArts
Copy link
Contributor

LekoArts commented Jun 2, 2022

Please try using gatsby@next (e.g. via npm install gatsby@next)

PixelyIon added a commit to skyline-emu/website that referenced this issue Jun 12, 2022
Due to gatsbyjs/gatsby#35607, `gatsby develop` is broken on newer versions of NodeJS due to broken `source-map`. A workaround to force using a high enough version fixes this and has been added to the `devDependencies`.
jrtibbetts added a commit to radarlabs/capacitor-radar that referenced this issue Aug 31, 2022
jrtibbetts added a commit to radarlabs/capacitor-radar that referenced this issue Aug 31, 2022
jrtibbetts added a commit to radarlabs/capacitor-radar that referenced this issue Aug 31, 2022
* master:
  [sc-9148] [project] Reverted the changed in the top-level package.json; the fix was needed only in the Example's package.json.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
jrtibbetts added a commit to radarlabs/capacitor-radar that referenced this issue Sep 6, 2022
…sc-11674/update-to-ios-3-5-3

* sc-9148-idiomatic-plugin-dot-swift:
  [sc-9148] [project] Reverted the changed in the top-level package.json; the fix was needed only in the Example's package.json.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Re-synced modules.
  [sc-9148] [project] Reverted the run script to be iOS-only.
  [sc-9148] [project] Docs.
  [sc-9148] [project] The run_example script now runs `gradlew assemble` for Android builds.
  [sc-9148] [refactor] Used a little more idiomatic Swift, meaning more guard statements, switches, and inferred types.
jrtibbetts added a commit to radarlabs/capacitor-radar that referenced this issue Sep 8, 2022
…nerate-plugin.m

* sc-9148-idiomatic-plugin-dot-swift: (46 commits)
  [sc-9148] [project] Reverted the changed in the top-level package.json; the fix was needed only in the Example's package.json.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Re-synced modules.
  bump package version to 3.4.2
  bump iOS version
  bump versions
  update package-lock.json
  var name
  fix function name
  fix options class
  bump versions
  expose setForegroundServiceOptions
  add --commit-hooks false and --git-tag-version false to the npm version command
  move npm version bump up earlier
  Update circleci to convenience images.
  swap out strings with single quotes for consistency
  Github actions conditionals fail with double quotes
  add template files and workflow to automate native SDK version bumps
  fix permission prompts
  ...
lonsagisawa added a commit to lonsagisawa/lon.sagisawa.me_2020 that referenced this issue Oct 30, 2022
@OliverHuntsman
Copy link

This fixed everything:

Stop server (ctrl+C)
Run gatsby clean
Delete node_modules folder
Delete package-lock.json file
Install Yarn if it isn't installed already (npm install -g yarn)
Run yarn install (yarn install)
Restart your server and test (gatsby develop)
Credit goes to Ferran.

@AKlaus
Copy link

AKlaus commented Feb 5, 2023

Same as parcel-bundler/parcel#8005 ?

Try forcing resolution "source-map": "^0.8.0-beta.0"

That worked! 👍
Open package-lock.json and find "source-map" under "node_modules/gatsby" --> "dependencies" and update the version.

bluejacket-c4 pushed a commit to code-423n4/code423n4.com that referenced this issue Mar 9, 2023
while the previous commit reminds devs to `nvm use` the
officially-supported version of node.js this dependency workaround helps
resolve an unneccessary gatsby crash on newer versions in the future

see
gatsbyjs/gatsby#35607 (comment)
for background
jsimonrichard added a commit to jsimonrichard/jsimonrichard that referenced this issue Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby type: upstream Issues outside of Gatsby's control, caused by dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants