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

Node 18: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize #683

Open
mikaello opened this issue May 14, 2023 · 0 comments

Comments

@mikaello
Copy link

Expected behavior:

No errors when using Node 18 or higher. Bug in source-map dependency (fixed in latest version): mozilla/source-map#454

Actual behavior:

Getting the following:

[14:06:45] Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
    at readWasm (/workspaces/my-project/example/node_modules/source-map/lib/read-wasm.js:8:13)
    at wasm (/workspaces/my-project/example/node_modules/source-map/lib/wasm.js:25:16)
    at /workspaces/my-project/example/node_modules/source-map/lib/source-map-consumer.js:264:14
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Your gulpfile:

Include your gulpfile, or only the related task (with ts.createProject).

import ts from "gulp-typescript";

const tsProjectLib = ts.createProject("../tsconfig.json", {
  rootDir: "../",
});
const LIB_SOURCE = "../src/**/*.ts";

const transpileLibTypescript = () =>
  src(LIB_SOURCE).pipe(tsProjectLib()).pipe(dest("../dist"));

task("default", () => {
  watch(LIB_SOURCE, transpileLibTypescript);
});

Workarounds

Set this environment variable: export NODE_OPTIONS=--no-experimental-fetch

OR

Upgrade source-map for gulp-typescript, here is the Yarn config (use overrides for NPM):

  "resolutions": {
    "gulp-typescript/source-map": "0.7.4"
  },
Click for NPM config
  "overrides": {
    "gulp-typescript": {
      "source-map": "0.7.4"
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant