Skip to content

LaughingBubba/svelte-spa-router-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Problem

I would expect that this link would route to the <NotFound/> component, but it doesn't. This does because the hash-bang is already in the route.

To Re-create Locally

Setup

git clone https://github.com/LaughingBubba/svelte-spa-router-example.git
cd svelte-spa-router-example
npm i

Run using sirv-cli

npm run dev

Then navigate to http://localhost:5000/ and type should-be-router404 at the end of the URL and press enter. It just remains on the route.

If you go to http://localhost:5000/#/should-be-router404 you'll get routed to the <NotFound/> component as expected.

Run using serve

If you happen to have serve installed globally:

serve ./public

This demonstrates the problem a little better as when you navigate to http://localhost:5000/should-be-router404 you fall through to serve's own 404.

About

Illustrating a possible bug in the router

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published