-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
--experimental-modules flag appears to be ignored #4385
Comments
I found issue #3751 and tried to use esm module instead of Thank you. |
The Example code: // foo.js
export const foo = "bar";
// index.js
import { foo } from './foo.js';
console.log(foo)
// package.json
{
"type": "module"
} Running with node directly: $ node -v
v12.6.0
$ node --experimental-modules index.js
(node:11912) ExperimentalWarning: The ESM module loader is experimental.
bar Running with pm2: $ pm2 --version
3.5.1
$ pm2 start index.js --node-args="--experimental-modules"
$ pm2 logs index --raw --err
(node:9712) ExperimentalWarning: The ESM module loader is experimental.
E:\GitHub\pm2-test\index.js:1
import { foo } from './foo.js';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Proxy.Module._load (internal/modules/cjs/loader.js:556:12)
at Object.<anonymous> (C:\Users\[REDACTED]]\v12.6.0\node_modules\pm2\lib\ProcessContainerFork.js:27:21)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at internal/modules/esm/translators.js:87:15 |
Thank you, @sidvishnoi. How can I solve it? I see |
No idea. I'm reporting to support this issue to be fixed.
Yes, there isn't. It has to be fixed at pm2 level. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I saw similar issue here, but it is old and closed. Therefore I create new issue.
Here is the simple example. It shows the problem. Look its
readme.md
file, please. How can I solve the problem?Thank you.
The text was updated successfully, but these errors were encountered: