localize-router icon indicating copy to clipboard operation
localize-router copied to clipboard

InitialNavigation enabled crashes Routing

Open macure opened this issue 6 years ago • 7 comments

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 avatar Feb 09 '19 21:02 macure

Same issue here! (Angular 7.1.0)

PierreLecigne avatar Mar 05 '19 18:03 PierreLecigne

I also have this error.

qubiack avatar Apr 03 '19 14:04 qubiack

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

Ismaestro avatar Jun 21 '19 09:06 Ismaestro

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

gmanojisaac avatar Jun 30 '19 23:06 gmanojisaac

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 :)

fess-v avatar Jul 18 '19 13:07 fess-v

sure it does, thanks @vladlensky !

Ismaestro avatar Jul 18 '19 13:07 Ismaestro

@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?

hymenoby avatar Jan 21 '20 11:01 hymenoby