I was trying to get custom svg icons for my website and used the "npm install @angular/[email protected] --save-dev" command and i suppose it screwed up all of my imports in app.module.ts. i tried deleting my node_modules and reinstalling them via npm install, but this made it worse (people kept saying it would work but it made everything worse). All of my imports have this error but at different locations:
Value at position 0 in the NgModule.imports of AppModule is not a reference
Value could not be determined statically.(-991010)
app.module.ts(55, 5): Unknown reference.
Has anyone had this issue or know how to solve it?
#All of my imported modules started acting up
11 messages · Page 1 of 1 (latest)
What does Angular CLI have to do with custom SVG icons?
Try quitting out of VS Code entirely and restarting it. If that doesn't work, share your package.json.
some of the imports are now working after a computer restart and quitting vs. now it's just the mat imports, which that was what was happening before
now the errors look like this:
'MatTableModule' does not appear to be an NgModule class.(-996002)
table-module.d.ts(5, 18): This likely means that the library (@angular/material/table) which declares MatTableModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
it has something to do with Ivy, but I can't figure out what it is
All of your dependencies that start with @angular/... should be set to similar (if not the exact same) version. Angular Material 10 is intended to be used with Angular 10. Your versions for cdk and cli are also out of sync.
how would i fix this? i'm still quite new to angular so i'm having a bit of a hard time navigating all of this
do i manually change it in the package.json or do i have to run a terminal command for each one i want to change?
The easiest way for you would probably be to just run ng update, which should put all Angular libs at the latest version.
But yes, alternately you could either manually edit package.json and run npm i or do it completely through the console with npm i [email protected]
i keep getting an error when trying to update some of them:
Error: Repository is not clean. Please commit or stash any changes before updating.