Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Load zone.js long-stack-trace in debug mode #3999

wants to merge 1 commit into from

Conversation

JohannesHoppe
Copy link
Contributor

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

[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');
Copy link
Contributor

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.

@JohannesHoppe
Copy link
Contributor Author

I see. Can you point me to a better place?

@JohannesHoppe
Copy link
Contributor Author

What do you think about this?

// uncomment this while debugging
// require('zone.js/dist/long-stack-trace-zone');

@JohannesHoppe JohannesHoppe reopened this Jan 18, 2017
@hansl
Copy link
Contributor

hansl commented Jan 18, 2017

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.

@JohannesHoppe
Copy link
Contributor Author

Excellent! 👍

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load zone.js long-stack-trace in debug mode
3 participants