Closed zgabievi closed 2 years ago
The library isn't compatible with Angular v13.
Upgraded to v4.0.2 and same error appears in console. Even though icons are rendered and working as expected.
Same problem again:
Angular CLI: 13.2.2 Node: 14.18.3 Package Manager: npm 6.14.15 OS: darwin x64
Angular: 13.2.1 ... animations, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, platform-server ... router, service-worker
@angular-devkit/architect - 0.1302.2 @angular-devkit/build-angular - 13.2.2 @angular-devkit/core - 13.2.2 @angular-devkit/schematics - 13.2.2 @angular/cli - 13.2.2 @nguniversal/builders - 13.0.2 @nguniversal/express-engine - 13.0.2 @schematics/angular - 13.2.2 rxjs - 7.5.2 typescript - .5.5 @ngneat/svg-icon - 4.0.2 @ngneat/svg-generator - 4.0.0
and so on for every module where svg icons are used...
Please reproduce on stackblitz.
I've found a solution. If someone would have same problem here it is.
In my case I was using lazy loading of components, using createNgModuleRef.
This method has second optional parameter, which should be injector. Just pass that parameter and console errors will disappear.
I'm submitting a...
Current behavior
In angular 13 there is an exception about icon registry: NullInjectorError: R3InjectorError(AuthInfoDetailModule)[SvgIconsModule -> SvgIconRegistry]. Icons are rendered, but exception is thrown in console. It was working with angular v12.
Expected behavior
It should not throw an exception.
Minimal reproduction of the problem with instructions
Upgraded angular 12 project to 13 and updated svg-icons to v3.3.0
What is the motivation / use case for changing the behavior?
Environment