ModuleWithProviders broken in v10.0.0-next.8
See original GitHub issue🐞 bug report
Affected Package
The issue is caused by package @angular/compiler-cli
Is this a regression?
Yes, the previous version in which this bug was not present was: 10.0.0-next.6 (maybe 10.0.0-next.7, skipped this one)Description
ngcc
fails to compile the NgModule.forRoot()
of my library.
Seems to be introduced by #36948 (commit)
🔬 Minimal Reproduction
git clone https://github.com/cyrilletuzi/angular-async-local-storage
cd angular-async-local-storage
git checkout ng10
npm ci
npm run build
npm run unit
You can also see the error in this CI test.
Source code is here (it’s a very simple NgModule with a classic forRoot()
).
🔥 Exception or Error
The identity given by StorageModule referenced in "static forRoot(config) {
return {
ngModule: StorageModule_1,
providers: [...],
};
}" doesn't appear to be a "class" declaration.
🌍 Your Environment
Angular Version:
Angular: 10.0.0-next.8
... common, compiler, compiler-cli, core, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1000.0-next.6
@angular-devkit/build-angular 0.1000.0-next.6
@angular-devkit/build-ng-packagr 0.1000.0-next.6
@angular-devkit/build-optimizer 0.1000.0-next.6
@angular-devkit/build-webpack 0.1000.0-next.6
@angular-devkit/core 10.0.0-next.6
@angular-devkit/schematics 10.0.0-next.6
@angular/cli 10.0.0-next.6
@ngtools/webpack 10.0.0-next.6
@schematics/angular 10.0.0-next.6
@schematics/update 0.1000.0-next.6
ng-packagr 10.0.0-next.1
rxjs 6.5.5
typescript 3.9.2
webpack 4.43.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
ModuleWithProviders Migration - Angular
For this reason, Angular version 9 deprecates ModuleWithProviders without a generic type. A future version of Angular will remove the default generic type, ......
Read more >Angular error - Generic type 'ModuleWithProviders<T ...
declare module "@angular/core" { interface ModuleWithProviders<T = any> ... Generic type 'ModuleWithProviders' requires 1 type argument(s).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Indeed it is a bug in the Es2105ReflectionHost changes to deal with IIFE wrapped classes.
The
StorageModule_1
identifier is declared as avar
and so this is not picked up as the “alias declaration” of the “inner declaration”.I’ll put together a fix tomorrow.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.