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
Better error message when module imports itself #14644
Comments
DzmitryShylovich
added a commit
to DzmitryShylovich/angular
that referenced
this issue
Feb 22, 2017
DzmitryShylovich
added a commit
to DzmitryShylovich/angular
that referenced
this issue
Feb 22, 2017
DzmitryShylovich
added a commit
to DzmitryShylovich/angular
that referenced
this issue
Feb 23, 2017
chuckjaz
pushed a commit
that referenced
this issue
Mar 7, 2017
SamVerschueren
pushed a commit
to SamVerschueren/angular
that referenced
this issue
Mar 18, 2017
asnowwolf
pushed a commit
to asnowwolf/angular
that referenced
this issue
Aug 11, 2017
juleskremer
pushed a commit
to juleskremer/angular
that referenced
this issue
Aug 28, 2017
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a ... (check one with "x")
Current behavior
When a module imports itself a generic
Uncaught RangeError: Maximum call stack size exceeded
is thrown which could have a whole bunch of reasons.
Expected behavior
It would be really nice if Angular could detect self-imports (maybe even circular imports if that's a thing) and show a more helpful error message to spare developers the time of debugging.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/hD9KHmgNKgiNYwXCUYp4
Run and check the console.
Removing AppModule from AppModule's imports resolves the problem.
What is the motivation / use case for changing the behavior?
Cause could be a developers mistake, wrong entry of autocomplete (many IDEs offer it as an option since the class is in scope) or even refactoring gone wrong (which would possibly cause hours of debugging, searching for self-generated loops in functions etc.), ...
Best clue when searching on the internet is this content, which is not even really related to the issue topic
#7930 (comment)
The text was updated successfully, but these errors were encountered: