-
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
Routing not working with AoT #2735
Comments
I tried to get inspiration from several other issues (#2577, #2678 (comment) etc) but no luck. |
If I had to bet, I'd say this is related to the Also, what is this chrome extension?
|
Oh. Sorry, I have tried so many things that I kinda got tired and copied the current output blindly. The case of However, the sync/bundled load case, and the lazy case are genuine issues I believe. Different ones as well. The reason for writing the function for bundled this way is the signature of the
Even when commenting it, I still get this error for lazy loading (I understand the Angular CLI configures Webpack for the lazy loading). Error going
|
Roger, will look at it. Thanks for the report and research btw, it's appreciated! |
Thanks heaps, man. It means a lot. On similar note, and NOT just returning the kind words, but you are truly superior. You are all over the place keeping the place in order, and shipping more awesomeness at the same time. You and the other maintainers are true heroes 💪 |
Heh, thanks ^^. We just really wanna see this work for users so we do put in a lot. AoT+bundling+lazy loading is THE big problem we're trying to tool around atm so we really need to get these kinks out and it's super useful to have detailed issues describing the broken scenarios. |
@filipesilva Do we have an update on this problem?
|
Before, we were using paths relative to base at all time, but these might not be the paths we get in System.import(), therefore we have to keep the relative path. Also fix e2e tests. BREAKING CHANGES: Using relative paths might lead to path clashing. We now properly output an error in this case. Fixes angular#2452 Fixes angular#2735 Fixes angular#2900
Before, we were using paths relative to base at all time, but these might not be the paths we get in System.import(), therefore we have to keep the relative path. Also fix e2e tests. BREAKING CHANGES: Using relative paths might lead to path clashing. We now properly output an error in this case. Fixes angular#2452 Fixes angular#2735 Fixes angular#2900
Before, we were using paths relative to base at all time, but these might not be the paths we get in System.import(), therefore we have to keep the relative path. Also fix e2e tests. BREAKING CHANGES: Using relative paths might lead to path clashing. We now properly output an error in this case. Fixes angular#2452 Fixes angular#2735 Fixes angular#2900
…2992) Before, we were using paths relative to base at all time, but these might not be the paths we get in System.import(), therefore we have to keep the relative path. Also fix e2e tests. BREAKING CHANGES: Using relative paths might lead to path clashing. We now properly output an error in this case. Fixes #2452 Fixes #2735 Fixes #2900
@hansl regarding the ngtools/webpack for non-cli users, this fix is being pushed to the @ngtools/webpack as well right ? |
When we release, yes. |
Just for information, AOT is now working with lazy loaded modules (in angular-cli 1.0.0-beta.21) ! See #2452 |
…ngular#2992) Before, we were using paths relative to base at all time, but these might not be the paths we get in System.import(), therefore we have to keep the relative path. Also fix e2e tests. BREAKING CHANGES: Using relative paths might lead to path clashing. We now properly output an error in this case. Fixes angular#2452 Fixes angular#2735 Fixes angular#2900
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?
macOS Sierra
Versions.
Tried final beta-17 and current master
angular-cli: local (v1.0.0-beta.17, branch: master)
node: 6.7.0
os: darwin x64
Repro steps.
Create a new project that has routes looking like this:
app-routing:
bundled-routing:
lazy-routing:
Full repository sample:
https://github.com/meligy/routing-angular-cli
The log given by the failure.
First, I run
ng build --aot
, and it shows successful output.Then, I run
ng serve --aot
, and it also shows successful output.Loading
/
But then I go to
http://localhost:4200/
, I see the page loading fine (the page content showssimple-route works!
), but in the browser console I see this error:Synchronous Loading (Same bundle)
/bundled
If I click on a router link that goes to
http://localhost:4200/bundled
, I get extra errors in the browser console, and the URL stays athttp://localhost:4200/
. Extra errors shown:Lazy Loading
/lazy
If I then refresh, and click on the router link that goes to
http://localhost:4200/lazy
, again, the URL stays athttp://localhost:4200/
, and I get another error:Mention any other details that might be useful.
I tried commenting different pieces of the routing but always get some sort of error. Also tried upgrading all Angular packages including @angular/router, @angular/compiler, @angular/platform-server and zone.js and ts-helpers to latest with no luck getting a clean browser console output.
The text was updated successfully, but these errors were encountered: