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

InitialNavigation enabled crashes Routing #157

Open
macure opened this issue Feb 9, 2019 · 7 comments
Open

InitialNavigation enabled crashes Routing #157

macure opened this issue Feb 9, 2019 · 7 comments

Comments

@macure
Copy link

macure commented Feb 9, 2019

I'm submitting a ... (check one with "x")

[ x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if similar feature request does not exist
[ ] support request => Suggested place for help and support is [stackoverflow](https://stackoverflow.com/), search for similar question before posting

Description

I'm not sure that this is a bug, or initialNavigation shouldn't be enabled in the first place.
If it's not a bug, then I guess, it would be useful for somebody else with similar problem.

"Can not match any routes. URL segment: en/home", when InitialNavigation is enabled.
https://angular.io/api/router/ExtraOptions

🔬 Minimal Reproduction (if applicable)

// ./app.module.ts
// ...
RouterModule.forRoot(routes, { initialNavigation: 'enabled' })
// End of imports

🌍 Your Environment

Angular Version:


Angular CLI: 6.2.9
Node: 11.5.0
OS: darwin x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.9
@angular-devkit/build-angular     0.8.9
@angular-devkit/build-optimizer   0.8.9
@angular-devkit/build-webpack     0.8.9
@angular-devkit/core              0.8.9
@angular-devkit/schematics        0.8.9
@angular/cli                      6.2.9
@ngtools/webpack                  6.2.9
@schematics/angular               0.8.9
@schematics/update                0.8.9
rxjs                              6.2.2
typescript                        2.9.2
webpack                           4.16.4

Localize Router Version:


"@angular/animations": "^6.1.0",
    "@angular/common": "^6.1.0",
    "@angular/compiler": "^6.1.0",
    "@angular/core": "^6.1.0",
    "@angular/forms": "^6.1.0",
    "@angular/http": "^6.1.0",
    "@angular/platform-browser": "^6.1.0",
    "@angular/platform-browser-dynamic": "^6.1.0",
    "@angular/router": "^6.1.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "core-js": "^2.5.4",
    "localize-router": "^2.0.0-RC.2",
    "rxjs": "~6.2.0",
    "zone.js": "~0.8.26"
@macure macure changed the title InitialNavigation eanbled crashes Routing InitialNavigation enabled crashes Routing Feb 9, 2019
@PierreLecigne
Copy link

Same issue here! (Angular 7.1.0)

@qubiack
Copy link

qubiack commented Apr 3, 2019

I also have this error.

@Ismaestro
Copy link

This is blocking us to use state transfer in Angular Universal! Need Help please!!

@gmanojisaac
Copy link

Please try
{
useHash: false,
initialNavigation: false
})

@fess-v
Copy link

fess-v commented Jul 18, 2019

https://medium.com/@fessbespalov/enabling-initialnavigation-with-localizerouter-and-angular-universal-8d514f1faad9
I had the same problem and wrote an article when solved, mb it'll help someone :)

@Ismaestro
Copy link

sure it does, thanks @vladLensky !

@hymenoby
Copy link

@vladLensky This does not work in my project, when i try try to access directly any page other than the root page, i get a route not found error, do you have a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants