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
Describe the bug
I'm trying to use remult in my project. I'd like to use ES modules.
I get the following error:
(node:2822177) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/me/ts-app-esm-template/node_modules/remult/esm/remult-express.js:1
import * as express from 'express';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
Node.js v18.3.0
Describe the bug
I'm trying to use remult in my project. I'd like to use ES modules.
I get the following error:
See GuillaumeDesforges/ts-app-esm-template#1
To Reproduce
Steps to reproduce the behavior:
WARNING requires node >= 18.x
yarn install
yarn build
node api
Expected behavior
The import should not fail.
The text was updated successfully, but these errors were encountered: