-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Load zone.js long-stack-trace in debug mode #3999
Conversation
[dist/long-stack-trace-zone.min.js](https://github.com/angular/zone.js/blob/master/dist/long-stack-trace-zone.min.js) should be loaded in the development environment to give more meaningful stack traces. Without this script, only the last VM turn is logged. When this script is loaded the stack will contain all VM turns from the point the async operation was initiated. fixes #2233
@@ -7,6 +7,8 @@ import { AppModule } from './app/app.module'; | |||
|
|||
if (environment.production) { | |||
enableProdMode(); | |||
} else { | |||
require('zone.js/dist/long-stack-trace-zone'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this is not the right way to go, as webpack will ALWAYS include that code in your bundle, even in production.
I see. Can you point me to a better place? |
What do you think about this?
|
I think the right place for this code would be as a script tag, after polyfills, if the target is dev. We're already refactoring that section of the code (poly fills), I'll ensure that's being done as well. |
Excellent! 👍 |
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. |
dist/long-stack-trace-zone.min.js should be loaded in the development environment to give more meaningful stack traces.
Without this script, only the last VM turn is logged. When this script is loaded the stack will contain all VM turns from the point the async operation was initiated.
fixes #2233