svelte-routing icon indicating copy to clipboard operation
svelte-routing copied to clipboard

Proxy error with Vite Hot Reload

Open hanako-eo opened this issue 2 years ago • 1 comments

I create an application with svelte on vitejs and I use svelte-routing.

On my App.svelte I have this:

<script lang="ts">
  import { Router, Route, Link } from "svelte-routing"
  import Home from "./routes/Home.svelte"
  import NF404 from "./routes/NF404.svelte"

  export let url = ""
</script>

<Router url={url}>
  <nav class="navbar">
    ... (links)
  </nav>
  <div class="container">
    <Route path="*"><NF404/></Route>
    <Route path="/"><Home/></Route>
  </div>
</Router>

and when i change this

<div class="container">
  <Route path="*"><NF404/></Route>
  <Route path="/"><Home/></Route>
</div>

to that

<div class="container">
  <Route path="/"><Home/></Route>
  <Route path="*"><NF404/></Route>
</div>

I have this error

"vite": "^2.9.0" "svelte": "^3.44.0", "svelte-routing": "^1.6.0"

image

hanako-eo avatar Apr 02 '22 14:04 hanako-eo

oh and also when i change this

<div class="container">
  <Route path="/"><Home/></Route>
  <Route path="*"><NF404/></Route>
</div>

to that

<div class="container">
  <Route path="*"><NF404/></Route>
  <Route path="/"><Home/></Route>
</div>

I have this

image

hanako-eo avatar Apr 02 '22 14:04 hanako-eo

Router can only have Route children, that is what I know so far. Also the 404 page should at the very bottom of the all routes

krishnaTORQUE avatar Sep 08 '23 07:09 krishnaTORQUE