Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x ] 3.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:
When I refresh a page that has a param in the URL using segment/:id I get
Uncaught (in promise): invalid link: redeem/593f2ac1e839b689d883448d
Expected behavior:
When I refresh the page, the component should load when providing a parameter in the url
Steps to reproduce:
GO to something like: http://localhost:8100/#/redeem/593f2ac1e839b689d883448d in my ionic app.
Related code:
@IonicPage({
name: 'redeem',
segment: 'redeem/:id',
defaultHistory: ['reward-goals']
})
Ionic info:
cli packages: (/Users/judsonterrell/.npm-global/lib/node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 1.3.7
Cordova Platforms : none
Ionic Framework : ionic-angular 3.0.1
System:
ios-deploy : 1.9.1
ios-sim : 5.0.13
Node : v6.11.0
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
PLEASE NOTE: refresh works fine is I just use segment: "redeem" with no params.
Hello! Thank you for opening an issue with us! Would you be able to provide a sample application via GitHub that demonstrates the issue you are having? Thanks for using Ionic!
Sure: PLEASE NOTE THE ISSUE IS FAILING SILENTLY, please use the console to see:

@kensodemann please see my updated comment with screenshot.
UPDATE:
So here is whats interesting, I can refresh the page on a node server etc, and everything works fine but its still throwing that error.

Any ideas?
@kensodemann just making sure you have seen my updates. I have provided all of the info I can on this. It seems the error itself is invalid and leads me to believe that it needs to be ignored or something. Not really sure what is triggering it.
Update looks like "link" is returning undefined:

And I found the issue...

You need to be doing a match for the name in the string for ones that have params attached to them. You are simply looking for "redeem" but you need to do something like:
linkOrComponent.match(/+lionk.name+/g) (pseudo code)
Can you fix this as a patch?
@kensodemann I change the function to this and it fixed the problem:
UrlSerializer.prototype.getLinkFromName = function (nameOrComponent) {
return this.links.find(function (link) {
return (link.component === nameOrComponent)
|| (link.name === nameOrComponent)
|| (nameOrComponent.indexOf(link.name )>-1); //added this line
});
};
No more error...

I do notice a glimpse of the :id param in the url though...

Any idea?
@judsonmusic - we have the updates. Thank you for all of the good information. I will mark this for someone to take a look at once bug fixes resume after the Ionic v4 release.
We have the same issue from a while.
@kensodemann sorry for my question, but what do you intend with after the ionic v4 release? Are you talking about the stable release? This could be in several months right, or is the stable release closer we know :)
@kensodemann since my function change works temporarily could you possibly tell me which name space I can use to access that function and override it temporarily? I'm not a fan of altering vendor code
@judsonmusic here is why this bug happens (at least partially) https://github.com/ionic-team/ionic/pull/12447
I'm pissed off that ionic team broke major functionality in 3.4 or 3.5 and didn't fixed it at all.
@ChezRD I think that their downfall is they rushed the framework enhancements because of high demand. It's sad. I am trying to get the browser version of our app solid before I even think about deploying to mobile and this is a definitely a hold up.
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!
Thank you for using Ionic!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/236
Most helpful comment
@ChezRD I think that their downfall is they rushed the framework enhancements because of high demand. It's sad. I am trying to get the browser version of our app solid before I even think about deploying to mobile and this is a definitely a hold up.