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

routing does not work in vite but it does work in snowpack #194

Closed
harshmandan opened this issue Mar 29, 2021 · 2 comments
Closed

routing does not work in vite but it does work in snowpack #194

harshmandan opened this issue Mar 29, 2021 · 2 comments

Comments

@harshmandan
Copy link

Describe the bug

I tried porting my project from snowpack to Vite but the navigate part isn't working in the dev mode. Its working fine when I'm building and serve-ing it. Another weird thing is that when I was using snowpack only the root route (in local env) would work, but with vite I can directly go to say localhost:3000/auth/login. (Ofc in production you would serve the index.js page for the 404, and it would work). The URL changes in the address bar of my browser, but the page does not change,

Reproduction

I've created a repo here: Link to repo
Just clone it, run npm i and just go to localhost:3000. You'll get stuck at loading.
Expected behavior is to go to the login page.
You will see the changed url in the address bar as well.
Refreshing the page or visit localhost:3000/auth
You'll be shown a link which navigates you to homepage.
Again you'll see that the url changes and content does not, and you can verify this now by refreshing the page and seeing the new content.

System Info

latest vite.
svelte
svelte-routing
@harshmandan
Copy link
Author

Okay an update on this. Link works. Neither navigate not use:link works. Can you please check what's wrong?

@sidharthramesh
Copy link

Related to #204 Solution in :#200

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

No branches or pull requests

2 participants