-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Unable to execute node ES Modules #10565
Comments
This is fixed by #10414 |
I just confirmed that #10414 fixes the issue. Thanks @bulldog98! Do you have any idea when this will get merged in and released? |
@jmattiace no plan when it will be merged, I'm still waiting for a maintainer to run the test, after that it should be merged |
I am getting the same error trying to migrate a project that depends on |
@KeithGillette the changes in #10414 fixed the issue for me. I would suggest using a debugger to ensure that the changes you made in the dependency file have in fact taken effect. |
Thank, @jmattiace. It turns out the custom
|
My whole project is halted because of this issue, and I've been seriously thinking of moving from NX to something else! Only the migration pain is what's holding me from pulling the trigger now. I'll probably just do it next couple of days, and move on! |
@omsharp you could patch the @nrwl/node module (it was moved in a later version of nx) where you just replace in src/executors/node/node-with-require-overrides.js the require with an import, that is a hotfix, until the nx team decides to introduce proper esm support |
@bulldog98 Sadly, I'm still getting the same error! I'm not sure if I'm doing something wrong! |
oh you just have to write instead of |
The same error for the bundle: Nest + Angular 15 + NG Universal. Fully agree with it((
|
Well, the same issue here, but started appearing after I added package |
same here with https://github.com/meetecho/janode |
Still an issue. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
When attempting to execute an ES Module with the
@nrwl/node:node
executor, we get the error reported in the below Failure Logs section. After debugging, I've identified that the issue is because the executor is attempting torequire
the module, which is of course not supported for ES Modules.Expected Behavior
The ES Module node.js application should properly execute without errors.
Steps to Reproduce
Pull this repo in order to reproduce.
nx generate @nrwl/node:app
tsconfig.app.json
with the following fields:project.json
build
target to use executor@nrwl/node:webpack
project.json
build
target with the following fieldsproject.json
serve
target to use executor@nrwl/node:node
webpack.config.js
file with the following contentFailure Logs
Environment
The text was updated successfully, but these errors were encountered: