Skip to content
New issue

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

When using root path '/' the page doesn't render on refresh #116

Closed
rob-balfre opened this issue Nov 15, 2017 · 9 comments · Fixed by #118
Closed

When using root path '/' the page doesn't render on refresh #116

rob-balfre opened this issue Nov 15, 2017 · 9 comments · Fixed by #118

Comments

@rob-balfre
Copy link

I'm trying to add a home '/' route to my app (using svelte-state-renderer). I've used the examples over on state-router-example as a base but when I change the route in login.js from 'login' to '/' or an empty string the page is blank on refresh.

@TehShrike
Copy link
Owner

Is the evaluateCurrent line updated?

Is the router emitting a routeNotFound event?

What is the url when you refresh? If you wipe out the hash fragment and refresh, does it behave differently?

@rob-balfre
Copy link
Author

evaluateCurrent is pointing to 'login'. routeNotFound is not being fired. If I manually remove the hash from the url and refresh it works.

@rob-balfre
Copy link
Author

It's pretty easy to recreate, just update this line to point to '/'

@TehShrike
Copy link
Owner

TehShrike commented Nov 16, 2017 via email

@TehShrike
Copy link
Owner

mm, I was able to reproduce. It looks like evaluateCurrentRoute doesn't have any effect when the url is / and the default state that you're giving it has a route of /. No events fired or anything. I'll make a unit test.

TehShrike added a commit that referenced this issue Nov 16, 2017
@TehShrike
Copy link
Owner

It's a bug in hash-brown-router :-o

TehShrike added a commit to TehShrike/hash-brown-router that referenced this issue Nov 16, 2017
When the current route was `/` and you would call `evaluateCurrent('/')`, nothing would happen.

Reported in TehShrike/abstract-state-router#116

Bug added in #08f93795
TehShrike added a commit that referenced this issue Nov 16, 2017
…-not-working-on-slash-route

Failing test for #116
@TehShrike
Copy link
Owner

Published as 6.0.4.

@TehShrike
Copy link
Owner

I confirmed that it works with that change to login's route in state-router-example.

Thanks for reporting! 👍

@rob-balfre
Copy link
Author

@TehShrike awesome thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants