We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hashbang mode is broken it do not accept valid changes and return '*' route
output context object:
canonicalPath: "/#!/user/100" hash: "" page: Object { current: "//user/100", len: 2, _decodeURLComponents: true, … } params: Object { 0: "//user/100", path: "/#!/user/100", query: "" } path: "//user/100" pathname: "/#!/user/100" querystring: "" routePath: "(.*)" state: Object { path: "/#!/user/100" } title: "app" : Object { pushState: pushState(), save: save(), … }
As you can see - here is double slash at path - so it can never be correct after hash change - and only '*' ist valid
I was able to fix this: @ function Context(path, state, pageInstance)
if (hashbang) this.path = this.path.replace('#!', '') || '/'; change to: if (hashbang) this.path = this.path.replace('/#!', '') || '/';
But i do not know if this has other sideeffects
The text was updated successfully, but these errors were encountered:
I have come across the same issue.
Sorry, something went wrong.
😞 🐼
Do it:
page('/', () => { page.redirect('/page/1') }) page('/notfound', console.log) page('/page/:number', console.log) page('*', ctx => { if (/^(\/\/)/.test(ctx.path)) { page.redirect(ctx.path.slice(1, ctx.path.length)) } else { page.show('/notfound') } }) page.start({hashbang: true})
That workaround avoid the problem! If you try set the URL via external link or using navigator address bar, will work!!
No branches or pull requests
hashbang mode is broken
it do not accept valid changes and return '*' route
output context object:
canonicalPath: "/#!/user/100"
hash: ""
page: Object { current: "//user/100", len: 2, _decodeURLComponents: true, … }
params: Object { 0: "//user/100", path: "/#!/user/100", query: "" }
path: "//user/100"
pathname: "/#!/user/100"
querystring: ""
routePath: "(.*)"
state: Object { path: "/#!/user/100" }
title: "app"
: Object { pushState: pushState(), save: save(), … }
As you can see - here is double slash at path - so it can never be correct after hash change - and only '*' ist valid
I was able to fix this:
@ function Context(path, state, pageInstance)
if (hashbang) this.path = this.path.replace('#!', '') || '/';
change to:
if (hashbang) this.path = this.path.replace('/#!', '') || '/';
But i do not know if this has other sideeffects
The text was updated successfully, but these errors were encountered: