-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ng update
fails for custom schematic with "An unhandled exception occurred: Cannot find module"
#20032
Comments
We are experiencing the same issue; an Angular 10 project/lib that throws this error when running I have narrowed it down and it appears in |
I see that the error messages have been updated in v12 which is nice but unfortunately didn't really help resolve the problem. But I do have more information. It appears that the package that is causing the error to be thrown doesn't contain an entry file (it's a package that only contains schematics, so one wasn't needed) and wasn't being detected as a package. I'm fairly sure this isn't a change in the behaviour of Adding a I still believe this is a regression bug, as the same package (without the entry file) has worked with all previous Angular CLI versions. |
…ints Some schematic only packages may not have entry points defined (`main`/`exports`). These type of packages will now be correctly resolved when attempting to locate update migrations. Fixes angular#20032
…ints Some schematic only packages may not have entry points defined (`main`/`exports`). These type of packages will now be correctly resolved when attempting to locate update migrations. Fixes #20032
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command
Is this a regression?
Yes, the previous version in which this bug was not present was: ~10.2.1 (and possibly anything less than 11.1.4)
Description
When running
ng update my-package
the process fails with the following error (full stacktrace included below):Our package depends on Angular 10.x, so this is being run in an Angular 10 workspace.
I believe this is a bug in the latest Angular CLI because:
ng update
the Angular CLI will check the version of the CLI installed locally and if it is not the latest version then it will install the latest version in a tmp dir and use that to run the updateNG_DISABLE_VERSION_CHECK=1 ng update ...
to disable the ‘use latest CLI’ behaviour and instead use the locally-installed v.10 of the CLI, then the migration completes successfully.🔬 Minimal Reproduction
ng update custom-schematic-package-name
🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: