Closed vneogi199 closed 1 year ago
ESM support for Nx plugins is tracked here: https://github.com/nrwl/nx/issues/15682
Its not a small effort and we don't currently have any updates, but it is on our radar. Stay tuned. 📺
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 using a custom NX plugin which has been built with es modules, I get the error:
require() of ES Module executor.js ... not supported
.When using "module": "commonjs", it works without issue.
From the stacktrace issue seems to be because we are using require here: https://github.com/nrwl/nx/blob/16.0.x/packages/nx/src/config/workspaces.ts#L336.
It would be great to have es modules supported as well in addition to commonjs.
Expected Behavior
User should be able to use plugin executors with es modules.
GitHub Repo
https://github.com/vneogi199/nx-examples/tree/es-module-plugin-issue
Steps to Reproduce
Nx Report
Failure Logs
No response
Operating System
Additional Information
No response