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

Build error You must provide the URL of lib/mappings.wasm #8005

Closed
bre7 opened this issue Apr 25, 2022 · 11 comments · Fixed by tweag/webauthn#179
Closed

Build error You must provide the URL of lib/mappings.wasm #8005

bre7 opened this issue Apr 25, 2022 · 11 comments · Fixed by tweag/webauthn#179
Labels
✖️ Non-Parcel bug Bugs related to dependencies or plugins

Comments

@bre7
Copy link
Contributor

bre7 commented Apr 25, 2022

🐛 bug report

Build was working fine days ago (before env was updated to Node 18).

🎛 Configuration (.babelrc, package.json, cli command)

parcel build --target=target2 dist2/perm.html --no-scope-hoist

.terserrc

{
  "compress": {
    "drop_console": true
  }
}

🤔 Expected Behavior

Build should be successful.

😯 Current Behavior

Error message is displayed on console:

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

  Error: You must provide the URL of lib/mappings.wasm by calling
  SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using
  SourceMapConsumer
  at readWasm
  (/home/circleci/project/web/node_modules/terser/node_modules/source-map/lib/read-wasm.js:8:13)
  at wasm
  (/home/circleci/project/web/node_modules/terser/node_modules/source-map/lib/wasm.js:25:16)
  at
  /home/circleci/project/web/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js:264:14
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async SourceMap
  (/home/circleci/project/web/node_modules/terser/dist/bundle.min.js:19385:20)
  at async minify
  (/home/circleci/project/web/node_modules/terser/dist/bundle.min.js:27785:41)
  at async Object.optimize
  (/home/circleci/project/web/node_modules/@parcel/optimizer-terser/lib/TerserOptimizer.js:131:16)
  at async PackagerRunner.optimize
  (/home/circleci/project/web/node_modules/@parcel/core/lib/PackagerRunner.js:364:20)
  at async PackagerRunner.getBundleResult
  (/home/circleci/project/web/node_modules/@parcel/core/lib/PackagerRunner.js:255:15)
  at async PackagerRunner.getBundleInfo
  (/home/circleci/project/web/node_modules/@parcel/core/lib/PackagerRunner.js:239:9)

💁 Possible Solution

Workaround was to rollback to Node 17 (17.9.0)

🔦 Context

💻 Code Sample

🌍 Your Environment

CircleCI with docker image cimg/node:18.0

Software Version(s)
Parcel 2.4.0
Node 18.0.0
npm/Yarn 1.22.18
Operating System Ubuntu 20.04.4 LTS
@devongovett
Copy link
Member

Based on the stack trace, looks like a problem with terser?

@jtojnar
Copy link
Contributor

jtojnar commented Apr 26, 2022

A bug in source-map: mozilla/source-map#432
Fixed but not in any stable version: mozilla/source-map#452
Terser bumped the dependency to beta but it have not had a release yet either: terser/terser#1164

@mischnic mischnic added the ✖️ Non-Parcel bug Bugs related to dependencies or plugins label Apr 26, 2022
@Mirokko
Copy link

Mirokko commented May 6, 2022

It is already merged. https://github.com/terser/terser/blob/v5.13.1/package.json#L48

@benpigchu
Copy link

As another workaround, export NODE_OPTIONS=--no-experimental-fetch should work

@bre7
Copy link
Contributor Author

bre7 commented May 7, 2022

Thanks ! Closing since both a solution (update terser or force resolution) and a workaround were provided

@neoswf
Copy link

neoswf commented Jun 17, 2022

I have updated Parcel locally and all dependencies, and even though I had to apply @benpigchu solution to be able to build.

JohT added a commit to JohT/data-restructor-js that referenced this issue Jul 19, 2022
Andersbakken added a commit to Andersbakken/smipper that referenced this issue Aug 11, 2022
some wasm issue.

These people had the same problem apparently:

parcel-bundler/parcel#8005
cometkim added a commit to daangn/websites that referenced this issue Oct 21, 2022
@warifp
Copy link

warifp commented Mar 7, 2023

As another workaround, export NODE_OPTIONS=--no-experimental-fetch should work

Thank!

@abhijit-chikane
Copy link

it is still not working for me

@phoenixeliot
Copy link

Working for me after updating to parcel 2.9.1 from 2.3.2, make sure you've updated your version @abhijit-chikane

@abhijit-chikane
Copy link

for me it was due to some other reason but anyway thanks

@nikita-fuchs
Copy link

If it is an option for you, you can also jump back to node 16 real quick for a minute, à la $ nvm use 16

MadLittleMods added a commit to MadLittleMods/vscode-rewrap that referenced this issue Nov 3, 2023
luwes added a commit to luwes/media-chrome that referenced this issue Feb 13, 2024
valotas added a commit to valotas/valotas.com that referenced this issue Jun 16, 2024
with `NODE_OPTIONS=--no-experimental-fetch` as described
[here](parcel-bundler/parcel#8005)
valotas added a commit to valotas/valotas.com that referenced this issue Jun 16, 2024
with `NODE_OPTIONS=--no-experimental-fetch` as described
[here](parcel-bundler/parcel#8005)
dnut added a commit to dnut/Rewrap that referenced this issue Dec 26, 2024
migrated from stkb#389

---------

* Fix tests trying to read differing cased files

Before this change:
```sh
$ node .config/do.mjs test
Error: ENOENT: no such file or directory, open './docs/specs/readme.md'
```

Tested on Linux (Manjaro, arch-based)

* Add support for Zig comments

Fix stkb#388

* Update `parcel` to fix packaging errors with Node.js 18

See parcel-bundler/parcel#8005

* build: package-lock.json

* ci: meaningless change to debug workflow

---------

Co-authored-by: Eric Eastwood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✖️ Non-Parcel bug Bugs related to dependencies or plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.