You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I import make-asynchronous on node 18.20. I import it in a .mjs file:
import makeAsync from "make-asynchronous";
but it immediately throws
[1] (node:6967) Warning: To load an ES module, set "type": "module" in the package.json or use
the .mjs extension.
[1] (Use `node --trace-warnings ...` to show where the warning was created) [1] /Users/timdaub/Projects/attestate/kiwistand/node_modules/web-worker/node.js:17 [1] import URL from 'url';
[1] ^^^^^^
[1]
[1] SyntaxError: Cannot use import statement outside a module [1] at internalCompileFunction (node:internal/vm:76:18)
[1] at wrapSafe (node:internal/modules/cjs/loader:1283:20)
[1] at Module._compile (node:internal/modules/cjs/loader:1328:27)
[1] at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
[1] at Module.load (node:internal/modules/cjs/loader:1203:32)
[1] at Module._load (node:internal/modules/cjs/loader:1019:12)
[1] at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:203:29)
[1] at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
[1] at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
[1] at async loadESM (node:internal/process/esm_loader:34:7)
[1] at async handleMainPromise (node:internal/modules/run_main:106:12)
[1] [1] Node.js v18.20.0
[1] npm run start exited with code 1
So I try to set type: module in my package.json but it isn't solving it.
However, when I go into node_modules/web-worker/package.json, and set it there, the problem is fixed.
Wasn't sure where to create the issue, maybe it's a web-worker issue
I import make-asynchronous on node 18.20. I import it in a .mjs file:
but it immediately throws
So I try to set type: module in my package.json but it isn't solving it.
However, when I go into node_modules/web-worker/package.json, and set it there, the problem is fixed.
Wasn't sure where to create the issue, maybe it's a web-worker issue
related issues at web-worker:
type: module
inpackage.json
developit/web-worker#44users of make-asynchronous can work-around this issue by defining in their dependencies
The text was updated successfully, but these errors were encountered: