jorgegorka / svelte-router

Svelte Router adds routing to your Svelte apps. It's designed for Single Page Applications (SPA). Includes localisation, guards and nested layouts.
MIT License
508 stars 42 forks source link

The routing does not take effect and always changes to 404.html #152

Open exqmjmz opened 1 month ago

exqmjmz commented 1 month ago

svelte version:4.2.12 my app.svelte code

<script lang="ts">
  import { Router } from 'svelte-router-spa'
  import { TestRoutes } from "@/routers/routers";

</script>
<Router {TestRoutes} />

my routers.js code

import Login from "@/pages/login.svelte";

export const TestRoutes = [
    {
        name: '/login',
        component: Login,
    }
]

When I try to access localhost:5173/login, the routing does not take effect. The routing does not take effect and always changes to 404.html.