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
In our monorepo we use local plugins for our custom executors and generators. In NX 18.2.4 these generators are working as expected, but after upgrading to NX 18.3.x the Typescript is not transpiled which results in a Cannot find module error
This error is caused by PR #22527. This PR adds running plugins in isolation behind a flag, but unfortunately, not all the functionally is behind the flag and it impacts also projects that don't have set the flag at the moment.
The error only occurs for generators that have an implementation pointing to a directory with an index.ts file. When you point the implemenation in the generators.json points to a ts file directly it works as expected.
Expected Behavior
The expected behavior is that generators are working in both NX 18.2.4 as in 18.3.x. Generators written in Typescript need to be transpiled before executed like it does in 18.2.4
Current Behavior
In our monorepo we use local plugins for our custom executors and generators. In NX 18.2.4 these generators are working as expected, but after upgrading to NX 18.3.x the Typescript is not transpiled which results in a
Cannot find module
errorThis error is caused by PR #22527. This PR adds running plugins in isolation behind a flag, but unfortunately, not all the functionally is behind the flag and it impacts also projects that don't have set the flag at the moment.
The error only occurs for generators that have an implementation pointing to a directory with an index.ts file. When you point the implemenation in the generators.json points to a ts file directly it works as expected.
Expected Behavior
The expected behavior is that generators are working in both NX 18.2.4 as in 18.3.x. Generators written in Typescript need to be transpiled before executed like it does in 18.2.4
GitHub Repo
nrwl/nx-examples#327
Steps to Reproduce
yarn nx g @nx-example/my-plugin:my-generator --dry-run
Nx Report
Failure Logs
NX Cannot find module '/Users/roozenboom/Work/npm/nx-examples/tools/my-plugin/src/generators/my-generator' Require stack: - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/src/config/schema-utils.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/src/command-line/generate/generator-utils.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/src/command-line/generate/generate.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/src/command-line/generate/command-object.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/src/command-line/nx-commands.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/bin/init-local.js - /Users/roozenboom/Work/npm/nx-examples/node_modules/nx/bin/nx.js Pass --verbose to see the stacktrace.
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: