Greentube / localize-router

An implementation of routes localisation for Angular
MIT License
193 stars 92 forks source link

InitialNavigation enabled crashes Routing #157

Open macure opened 5 years ago

macure commented 5 years ago

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"
PierreLecigne commented 5 years ago

Same issue here! (Angular 7.1.0)

qubiack commented 5 years ago

I also have this error.

Ismaestro commented 5 years ago

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

gmanojisaac commented 5 years ago

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

fess-v commented 5 years ago

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 commented 5 years ago

sure it does, thanks @vladlensky !

hymenoby commented 4 years ago

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