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

When template has an error, it breaks most of the page #2413

Closed
mhevery opened this issue Jun 8, 2015 · 12 comments
Closed

When template has an error, it breaks most of the page #2413

mhevery opened this issue Jun 8, 2015 · 12 comments
Labels
area: core Issues related to the framework runtime effort1: hours freq1: low type: bug/fix

Comments

@mhevery
Copy link
Contributor

mhevery commented Jun 8, 2015

When there is an error in the template, the CD stops and breaks the remainder of the page. Instead we should just publish the error and continue on processing the remainder of the page.

@mhevery
Copy link
Contributor Author

mhevery commented Aug 21, 2015

@vicb is this still the case or should we close this issue?

@vicb
Copy link
Contributor

vicb commented Aug 21, 2015

Not sure, did you mean to ask @vsavkin ?

@mhevery
Copy link
Contributor Author

mhevery commented Aug 22, 2015

sorry @vicb


@vsavkin is this still the case or should we close this issue?

@pkozlowski-opensource
Copy link
Member

IMO still an issue, we had a report of it recently in #9212. Here is a plunker to reproduce: https://plnkr.co/edit/iHDYpZ3fDlO6bhOtlTbQ?p=preview

@mhevery mhevery added area: core Issues related to the framework runtime and removed comp: core/change_detection labels Sep 7, 2016
@vicb
Copy link
Contributor

vicb commented Sep 24, 2016

Seems like the exception reporter is called but it continues working
https://plnkr.co/edit/pzRoDmUrOTyK4sZqgb4L?p=preview

@vicb vicb closed this as completed Sep 24, 2016
@garethdn
Copy link

@vicb In the plnkr you linked, yes the exception is thrown but only thrown once. i.e repeatedly clicking break it will only throw the exception once. Also the view no longer updates on clicking of the do it button.

@LanderBeeuwsaert
Copy link

Same here. I encounter this throughout my app, even with a custom errorHandler. Some parts of the view (not all) will stop updating.

@AlexMinsk
Copy link

As I understand all happens in angular/module/@angular/core/src/linker/view.ts.

On break it the this.cdMode = ChangeDetectorStatus.Errored is set in class DebugAppView function _rethrowWithContext.

On Do it, when cdMode has status Errored, changes are not applied in class AppView function detectChanges, because cdMode is compared to ChangeDetectorStatus.Errored and function simply returns without invocation this.detectChangesInternal(throwOnChange);
So in case when cdMode = Errored changes are ignored.

@AlexMinsk
Copy link

And exception is thrown every time on clicking the button break it, but not written in the console since the ErrorHandler is unsubscribed after the first exception:
core.umd.js: function onHandleError
rxjs/Subject.js: function Subject.prototype.next
rxjs/Subscriber.js: function SafeSubscriber.prototype.__tryOrUnsub
core.umd.js: function ErrorHandler.prototype.handleError

@gbilodeau
Copy link

We would love to see this fixed - either through a less brutal built-in strategy or by allowing a custom ErrorHandler to implement a more lenient strategy. As it stands right now, any error thrown in a page makes the page unresponsive and forces the user to reload to resume his work.

@tbosch tbosch added this to PRs in Compiler Apr 11, 2017
@tbosch tbosch moved this from PRs to Prio2 in Compiler Apr 11, 2017
@tbosch tbosch self-assigned this Apr 28, 2017
tbosch added a commit to tbosch/angular that referenced this issue Apr 29, 2017
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes angular#9531
Fixes angular#2413
Fixes angular#15925
tbosch added a commit to tbosch/angular that referenced this issue May 1, 2017
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes angular#9531
Fixes angular#2413
Fixes angular#15925
@matsko matsko closed this as completed in e263e19 May 2, 2017
@tbosch tbosch moved this from Prio_col0 to Done in Compiler May 2, 2017
matsko pushed a commit that referenced this issue May 4, 2017
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes #9531
Fixes #2413
Fixes #15925
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes angular#9531
Fixes angular#2413
Fixes angular#15925
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
- prevents unsubscribing from the zone on error
- prevents unsubscribing from directive `EventEmitter`s on error
- prevents detaching views in dev mode if there on error
- ensures that `ngOnInit` is only called 1x (also in prod mode)

Fixes angular#9531
Fixes angular#2413
Fixes angular#15925
@tbosch tbosch removed this from Done in Compiler Oct 3, 2017
@SirZach
Copy link

SirZach commented Jan 28, 2019

I'm on Angular 7 and just came across this. My template throws an error from referencing a non-existent property, it's caught in the global error handler, but the UI stops working. I am mostly using angular material components so maybe it's an issue there.

https://stackblitz.com/edit/template-error-breaks-ui is a stackblitz reproducing the issue. Click the first panel, notice it doesn't fully open. Click the second panel and it also doesn't fully open. If you click the second panel first, it will fully open.

@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 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime effort1: hours freq1: low type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.