-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
bug(pipes): cannot read property 'constructor' of undefined #6425
Comments
this doesn't throw any errors for me? Browser / OS ? |
@robwormald oops, wrong plunk link, fixed now. |
dup of #5169 |
Same error as #5169, just slightly different way of getting it. |
Hi! Same error for me when the pipe is not instantiated and is going to be deshydraded. In my case, consider a route protected by login (ie: /home/profile). In case of user session expired, and user call directly the route, the login redirect outlet redirect to route /login but when angular trying to deshydrate the profile component (that use a pipe), exception is thrown. Here is the stack: Browser: Chrome Version 48.0.2564.97 A workaround is to add a condition on element using pipe, to display it only when component onInit has been called. |
Got the same error! +1 |
+1 |
+1 |
Same as #5169. Pretty serious problem, hope this gets bumped to P1. |
+1 |
1 similar comment
+1 |
kevinsdooapp's solution is working for me, Working copy:
|
@davidreher ok but doing this in all component is not good idea. This will be done automatically mean its good |
Totally agree. we can wait ... |
Hitting this one as well on beta 12. |
what es6 shim version are you using? |
"es6-shim": "^0.35.0", |
I'm also encountering this issue on upgrading to Angular 2 beta.13. For me it happens when I attempt a login redirect, using router.navigateByUrl in a custom RouterOutlet. The following errors are being thrown during the destruction of the previous component.
Importantly I do not have any pipes, async or otherwise, in the components in question. [UPDATE] Adding a completely unused and unneeded async pipe to the template of the component being destroyed resolve the issue. This makes no sense and is rather annoying, I assume this is an angular bug. |
@jonmiles I'm seeing the same issue when using router.navigateByUrl. Do you have a quick example you could post of the workaround you mentioned about including a unused async pipe? I'd like to try it and see if it unblocks the error on my app too. |
@ChrisPearce I simply added Seems like an issue with recent Router changes... any ideas? |
I got a very similar error message triggered by a empty templateUrl in Component decorating. |
Sounds about right, from what I understand the error is thrown while attempting to clean up a component's pipes which do not exist. Really need a fix for this to move forward! |
I'm using pipes and this error occurred after several arrays go through the pipe, but it is not consistent. Sometimes the error appear after one, two or more clicks (each click will make a new/old array goes through the pipe). I'm not sure whether this is related with this bug, but this is the trace (I'm using angular 2 beta 13): angular2.dev.js:23877 TypeError: Cannot read property 'constructor' of undefined This bug is a blocker for migrating to Angular 2 for me. |
I've had this issue when imperatively navigating away from a default route. I.e. if I directly visit https://myapp/login, but my app detects that I'm already logged in and re-directs me to the default logged in view. |
@jeffbcross I've noticed this issue whenever I route to a view that contains a pipe but no data gets passed into that pipe before I navigate away (i.e. the async pipe but the observable doesn't get instantiated before the user navigates away). It's probably the same thing you're running into. |
+1 |
I have a same issue with ng2-translate, and the workaround works for me
|
I'm seeing this error in beta 14. My component is using routing to check OnActivate if a user prop on a service is undefined, if yes redirect to Login, else show results of in a table. I refactored my property (which was working) from Then added the async pipe to my ngFor in the template and got the mentioned exception: angular2.dev.js:23941 Error: Uncaught (in promise): TypeError: Cannot read property 'constructor' of undefined I'll go back to my original implementation, calling subscribe from within the component and using a non-Observable array for the time being. |
I'm encountering this issue on Angular Beta 14, did not occur before, it's on any kind of route and occurs on only one page. Not sure why, but I do use some currency and date pipes. |
Issue remains actual on Angular 2 Beta 15. |
Does this issue still occurs with rc2 ? |
@vicb never had this issue since rc2 |
Closing, please re-open with an updated plunker if this is still a pb on rc2+ |
I have it. |
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. |
See this plunker: http://plnkr.co/edit/rHGx6CoX2lKy6WVFMkFI?p=preview
Related: #6288 for a similar issue with
ngSwitch
The text was updated successfully, but these errors were encountered: