Ionic-framework: Deeplinker invalid page component.

Created on 24 Nov 2016  路  5Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Custom deeplinking is being mixed with Ionic DeepLinker:
nav-util.js:18 invalid page component: null
it happens when using browser history back (and hash changes in the url).

Expected behavior:
Because of the heavy complexity in the page navigation I was forced to create my own deeplinker module. It works properly, however its getting mixed with the Ionic's DeepLinker.
I suppose DeepLinker shouldn't be used when we don't have any DeepLinkConfig.

My guess is that DeepLinker shouldn't always subscribe to: this._location.subscribe on init.

Steps to reproduce:
Add some hash in the webapp and go back.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.3.0 
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: OS X El Capitan
Node Version: v7.0.0
Xcode version: Xcode 7.2 Build version 7C68
stale issue

Most helpful comment

I faced with the similar issue. Will anyone from Ionic 2 team help with this?
ionic info:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.2.1 Build version 8C1002

This works fine for devices, but for browser is not.
I have this links:

const links = [
  { component: LoginPage, name: 'Login', segment: 'login', useAsDefault: true },
  { component: ContactsPage, name: 'Contacts', segment: 'contacts' },
  { component: ChangeContactPage, name: 'NewContact', segment: 'change-contact', defaultHistory: [ContactsPage] },
  { component: ChangeContactPage, name: 'ChangeContact', segment: 'change-contact/:contactId', defaultHistory: [ContactsPage] }
];

And then I have this:

imports: [
    IonicModule.forRoot(App, {}, {links})
  ]

When in browser's url I typing __localhost:8100/#/login__ it is ok, if I add some hash to url like this: __localhost:8100/#/loginasdfkahsdgfjkhasdf__ is shows error:

nav-util.js:23 invalid page component: null

Can someone help me?

All 5 comments

I faced with the similar issue. Will anyone from Ionic 2 team help with this?
ionic info:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.2.1 Build version 8C1002

This works fine for devices, but for browser is not.
I have this links:

const links = [
  { component: LoginPage, name: 'Login', segment: 'login', useAsDefault: true },
  { component: ContactsPage, name: 'Contacts', segment: 'contacts' },
  { component: ChangeContactPage, name: 'NewContact', segment: 'change-contact', defaultHistory: [ContactsPage] },
  { component: ChangeContactPage, name: 'ChangeContact', segment: 'change-contact/:contactId', defaultHistory: [ContactsPage] }
];

And then I have this:

imports: [
    IonicModule.forRoot(App, {}, {links})
  ]

When in browser's url I typing __localhost:8100/#/login__ it is ok, if I add some hash to url like this: __localhost:8100/#/loginasdfkahsdgfjkhasdf__ is shows error:

nav-util.js:23 invalid page component: null

Can someone help me?

The issue still in Ionic v2 final release

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.2.0
Xcode version: Not installed

Same happening here.

Please help with a possible fix

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gio82 picture gio82  路  3Comments

brandyscarney picture brandyscarney  路  3Comments

brandyscarney picture brandyscarney  路  3Comments

MrBokeh picture MrBokeh  路  3Comments

manucorporat picture manucorporat  路  3Comments