Open intellix opened 5 months ago
@intellix Did you find any workaround? I think I'm also running into this. All imports within my libraries that I import into my executor are failing.
nope haven't found a workaround. Was hoping to move our extract-schema scripts to executors but right now I'm blocked on that so moved onto other work and was awaiting some more information about this
Current Behavior
We're creating an executor that can read a graphql schema and output a .graphql file for generating types later. Our project is commonjs because we have bi-directional circular issues: https://github.com/nrwl/nx/issues/2975#issuecomment-782069044
When we run the executor (commonjs) against a library (commonjs) we're getting an error as though the commonjs module setting is completely ignored:
I'm assuming that it's not running in a commonjs environment:
Command:
Expected Behavior
It should run the executor in commonjs mode.
GitHub Repo
https://github.com/intellix/nx-commonjs-executor
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
If I try to run this code (from Chat GPT) it says that I'm running in a CommonJS environment, but I'm not sure (I have to remove the ESM check cause it doesn't compile but it still logs CommonJS):
Another confusing thing, is that I can't get it to fail with a serve/build when I remove commonjs as the module (everywhere) to try and replicate the issue that used to exist (https://github.com/nrwl/nx/pull/5129/files):