Ugraded to Angular 9: Error: Can't resolve all parameters for ApplicationModule: (?).
See original GitHub issueI upgraded my app to Angular 9 & am getting the following error:
Error: Can't resolve all parameters for ApplicationModule: (?).
at syntaxError (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:7582:17)
at CompileMetadataResolver._getDependenciesMetadata (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:27327:35)
at CompileMetadataResolver._getTypeMetadata (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:27219:26)
at CompileMetadataResolver.getNgModuleMetadata (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:27087:24)
at CompileMetadataResolver.getNgModuleSummary (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:26889:35)
at /home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:27008:51
at Array.forEach (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:26996:49)
at CompileMetadataResolver.getNgModuleSummary (/home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:26889:35)
at /home/brian/work/dishzilla/menus-angular-2-app/apps/angular-app/dist/server.js:26981:55
I have spent hours debugging this issue, but still have not made progress. I’ve also seen a number of fixes for this error message in previous years but none of those solutions worked for me. Can you please advise on obtaining a better error message that is easier to debug, because this error message is not very helpful. Thank you
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:29 (7 by maintainers)
Top Results From Across the Web
angular - Can't resolve all parameters for ApplicationModule
There is no Application Module . I found out what the error was, I'm going to post it in an answer. – Alavaros....
Read more >Fixing the "can't resolve all parameters" exception with ...
Here's what the error looked like: Can't resolve all parameters for QuillConfigurationDirective: [object Object], (?). The (?) indicates that ...
Read more >NgModule FAQ - Angular
NgModules help organize an application into cohesive blocks of functionality. This page answers the questions many developers ask about NgModule design and ...
Read more >Can't resolve all parameters for component in Angular
Sometimes you can get this error while running tests or in the browser console. Also, you can face this error after updating the...
Read more >angular 4 pass parameter to service, uncaught error can t resolve all ...
The Angular adds the map all the route parameters in the ParamMap object, which can be ... uncaught error can t resolve all...
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 Free
Top 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
In my case (Angular 6 -> 6.1 LTS upgrade), it was because some idiot added
window.global = {window};
toindex.html
. Removing that cleared the error. Spent 4 hours trying to track this down. Angular sucks.@AndrewKushnir Unfortunately, I cannot provide a simple reproduction due to the complexity of the app. I added some logging statements & noticed that when
ReflectionCapabilities.prototype._ownParameters
is invoked on theApplicationModule
reflectiontype
, the logic falls through to theIf a class has no decorators, at least create metadata
case.[ undefined ]
is returned since the constructor has an arity of 1.https://github.com/angular/angular/blob/master/packages/core/src/reflection/reflection_capabilities.ts#L123
When
@angular/core/fesm5/core.js
is loaded. Here is the definition ofApplicationModule
in that file.I’m not familiar with how to access the source of the
ApplicationModule
type
object, as directly mutatingApplicationModule
does not seem carry over to thetype
object passed toReflectionCapabilities.prototype._ownParameters
.One thing I hope to get out of this issue is to identify the source of the problem & to have an error that directly notifies the programmer of the cause of the error.
I thought ivy was enabled by default on Angular 9. I admit that I don’t use Angular for most of my projects so I’m a bit out of the loop with the evolution of Angular & it’s various architectural updates. I’ll investigate if Ivy is being used…
@ericmartinezr I noticed that you gave a thumbs down on this issue. I’d love to provide more detail about the reproduction, but I’ve been spending > 6 hours trying to identify the issue. Is this not an area that can be improved or am I supposed to “suck it up” & pretend that everything is ok or something like that? I’d rather there be a quicker way to fix this problem without the need to file an issue in the first place. Since this same error has been reoccurring for years (since v2), with multi-hour debug sessions, is this not an area that can be improved to help developers?