-
Notifications
You must be signed in to change notification settings - Fork 12k
bug: lazy loading routes with property undefined and error when redirecting #3662
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
Comments
Upgrade to Angular CLI beta 24, or Angular 2.3 (or higher), that will fix the problem. |
tengo el mismo problema en Windows. Ayuda please! |
Fixed: upgrading Angular to ^2.4.0 worked for me. Thanks. "@angular/common": "^2.4.0",
"@angular/compiler": "^2.4.0",
"@angular/core": "^2.4.0",
"@angular/forms": "^2.4.0",
"@angular/http": "^2.4.0",
"@angular/platform-browser": "^2.4.0",
"@angular/platform-browser-dynamic": "^2.4.0",
"@angular/router": "~3.4.0",
"angularfire2": "^2.0.0-beta.6",
"core-js": "^2.4.1",
"firebase": "^3.6.4",
"rxjs": "^5.0.0",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2" |
Soy nuevo en angular, me puedes dar algunas ideas de como actualizo mis paquetes de angular2? |
Not working for me...
|
I had the same problem and update worked for me: Before was using: I updated to the latest version: |
Ups they did it again :( All my projects are broken. |
I'm seeing this error now also.
|
npm install -g angular-cli@latest angular-cli: 1.0.0-beta.22-1 @latest still points to beta 22 it seems |
Did you clear your cache after uninstalling? I just ran None the less, the issue persists on beta.24 |
yup...cache cleared, but hey ho. npm install -g [email protected] worked for me on beta.22-1
on beta.24
|
I'm seeing this error on: What i did now: @ existing project folder:
@ new one:
|
@antonio-rodrigues: Yeah in new projects there are no routes ;) |
Do we have a suggested fix for existing projects? Can confirm it is no longer happening if I create a new project... |
@egandro DOH! of course not... Did setup a test route and the result was the expected one:
Second that: |
Please pin angular-cli internal dependencies! The new release of ngtools/webpack completely breaks my build and I've pinned angular-cli to 1.0.0-beta.22-1. I've fixed this by adding a dependency of my own to ngtools/webpack v1.1.9 This is going to make it a nightmare to upgrade when I'm finally able to do that. Edit : Just to make this absolutely clear, I haven't added this comment into this issue for no reason. The release of ngtools/webpack ^1.2.0 is what causes the error |
I can confirm upgrading to beta-24 and angular 2.4.0 fixed the issue |
AH! So it turns out my existing projects continued to fail due to the dev dependency not being updated also. Silly mistake I missed! Updated my package.json to After updating my project version and my global version, this has been resolved :) |
@psurrey && @nombienombie which webpack version?
|
Hi @hansl , thanks for all your work. Can you reconsider opening this bug as below? This has not been resolved for me since upgrading to beta.24 introduces another bug, #3674. I am using AoT builds, and I think it is because the dependencies have not been re-exported with the latest ng compiler. So, upgrading to beta.24 / angular 2.3.0+ may not be a feasible solution for all AoT apps out there that has such dependencies. We may need a beta.22-2 version so as to not force an breaking upgrade to Angular 2.3.0+ |
@nombienombie thanks for the tip! @egandro i'm not using lazy loading for now, and here's my package content:
|
@antonio-rodrigues no problemo ;) @egandro my package.json is as follows :
|
@jdpearce can you help us with more detailed instructions on how you pinned the angular cli internal dependencies? Regarding ngtools/webpack 1.1.9? This change in internal dep may be the culprit for another issue, #3682, as bmbrown10 suggested. |
To all: The error pointed to by the creator is the following:
This has been fixed in angular 2.3.1. The other issues you guys are discussing should be kept in a separate issue. I will not reopen this. |
@egandro @antonio-rodrigues possible solution without upgrading to 2.3.1 (per @jdpearce, thanks!) Pin ngtools/webpack to 1.1.9 by adding This way your app will still build/serve while running beta.22 / 2.2.3, and can hold off on upgrading to 2.3.1+, since for that version, many 3rd party libraries are not yet aot-compatible. |
i get this error with:
and then i also get some sass-loader errors like
if I roll back angular-cli to |
Issue solventado al actualizar a la versión 1.0.0-beta.24 Detalle de mi ambiente de desarrollo: angular-cli: 1.0.0-beta.24 |
it may be help. Team-Directive17-Angular2/Angular2-Course-Project@1770529 not only update angular-cli ,but also update your package.json file. |
…t read property 'listLazyRoutes' of undefined" as suggested in angular/angular-cli#3662.
Im starting to think an "ng update" command would be great. |
I was seeing the original issue - I updated angular-cli to beta.24:
However now this has created another error. When navigating to one of my lazy loaded routes, I get the following error:
I have changed no code (only package.json versions) and this route was loading previously. Anybody any idea why this is happening? |
Needed to upgrade Angular as it was a bug with current version: angular/angular-cli#3662
I had the same issue working with I did the following to get a fix:
Everything then started working, no errors |
I had the same issue working with I did the following to get a fix: rmdir -rf node_modules dist |
I should of added that client I upgraded to was |
I have updated my Angular dependencies to 2.4.0 and Angular-CLI to and I still see the ERROR in Cannot read property 'listLazyRoutes' of undefined but webpack compiles successfully and loads the app in the browser. |
Uninstalled older CLI |
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. |
OS?
Mac OSX El Capitan
Versions.
angular-cli: 1.0.0-beta.22-1
node: 6.9.1
os: darwin x64
Repro steps.
Yes, this app was created with the CLI. The app runs fine on my laptop. However, on my larger, more powerful Mac Desktop, the error(s) occur. 2 errors occur which are both associated with my lazy loading of modules.
listLazyRoutes
on an undefined variable.The log given by the failure.
The
listLazyRoutes
error:The error that prevents me from setting a redirect url to a lazy loaded path like the following (and yes, I have tried relative urls).
Error log:
Mention any other details that might be useful.
I believe the
listLazyRoutes
property is in thenode_modules/@ngtools/webpack/src/plugin.js
file:Like I said, this issue doesn't occur on my laptop. Maybe it has to do with the speed at which the modules are loaded, running code that accesses the property of an object that hasn't yet been set? I'm not sure...
Thanks everyone!
The text was updated successfully, but these errors were encountered: