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
Cannot find module when executing Generator #13696
Comments
This is also happening in our repo as well. NX 15.3.0 cannot resolve our local plugins. We had to revert to a previous version to get it working again. |
Thanks for the workaround. I had the same issue with version 15.3.0. No issue with version 15.2.0. |
After investigation I found that it was a Windows path format related issue. A fix to the problem is already merge #13801 so I guess the issue should be gone in close futur release :) |
Thanks @mottet for investigating! For everyone who cannot wait for the fixed version, you can simply patch the src file in Add new line 14 const { normalizePath } = require("./path"); Change line 134: const possiblePaths = (_a = tsConfigPaths[importPath]) === null || _a === void 0 ? void 0 : _a.map((p) => normalizePath(path.relative(root, path.join(root, p)))); |
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
After upgrading to NX 15.3.0 my generators cannot be executed anymore.
Expected Behavior
The generator should be invoked successfully
Github Repo
No response
Steps to Reproduce
Not sure if this is a mistake on my end, so I quickly created a fresh nx workspace to test it out following along https://nx.dev/nx/create-nx-workspace:
yarn create nx-workspace
integrate monorepo
repository name temp
application name tempapp
default stylesheet css
I followed https://nx.dev/recipes/generators/local-generators to create a plugin and generator
npm install @nrwl/nx-plugin@15.3.0
nx g @nrwl/nx-plugin:plugin my-plugin
nx generate @nrwl/nx-plugin:generator my-generator --project=my-plugin
Trying to execute the generator results in an error:
nx generate @temp/my-plugin:my-generator mylib --verbose
Using TS 4.9.4
Did I miss something or is this really a bug? I noticed that libs/my-plugin/src/index.ts is empty, but maybe that is supposed to be like that!?
Nx Report
Failure Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: