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

With paths.base configured, index page is inaccessible without a trailing slash #2886

Closed
ebeloded opened this issue Nov 24, 2021 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@ebeloded
Copy link

Describe the bug

When kit.paths.base is configured, the index page cannot be accessed without a trailing slash. Adjacent pages work.

Config:

const config = {
  kit: {
    paths: {
      base: '/admin',
    }
}

files:

src/routes/index.svelte
src/routes/not-index.svelte

With the above setup, here's how it works:

/admin - 404 (but expected index)
/admin/ - index
/admin/not-index - not-index

Reproduction

The issue reproduced on Stackblitz: https://stackblitz.com/edit/sveltekit-44rsrt?file=svelte.config.js

When the app is running, try navigating to /admin to see the 404.

Repo: https://github.com/ebeloded/sveltekit-base-path-index-issue

Logs

No response

System Info

System:
    OS: Linux undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: Unknown - /bin/jsh
  Binaries:
    Node: 14.16.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /bin/yarn
    npm: 7.17.0 - /bin/npm
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.196 
    svelte: ^3.42.6 => 3.44.2

Severity

blocking all usage of SvelteKit

Additional Information

We need to be able to use the app from a non-root path and having a working index page is critical

@aplotor
Copy link

aplotor commented Nov 26, 2021

+1 i am experiencing the same issue. also, static-adapter build fails with error > 404 (linked from /) when kit.paths.base is configured.

@benmccann benmccann added this to the 1.0 milestone Jan 18, 2022
@benmccann benmccann added the bug Something isn't working label Jan 18, 2022
@nhe23
Copy link
Contributor

nhe23 commented Jan 18, 2022

With the current version of Sveltekit (v1.0.0-next.232) I cannot reproduce this issue. Here is my repo: https://github.com/nhe23/test-2886. It also works in the stackblitz-repo that is mentioned in the issue description, which uses the newest version of Sveltekit.

@ebeloded
Copy link
Author

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants