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

Endpoint Fallthrough Bug #4212

Closed
lemmon opened this issue Mar 4, 2022 · 2 comments
Closed

Endpoint Fallthrough Bug #4212

lemmon opened this issue Mar 4, 2022 · 2 comments

Comments

@lemmon
Copy link

lemmon commented Mar 4, 2022

Describe the bug

Problem happens when you have multiple dynamic routes at the same level. Example:

[page]/index.js
[page]/index.svelte
[project]/index.js
[project]/index.svelte

Expected behavior is that you first check whether the [page] is a valid page. If yes, you return props and render the page. If NOT you should be able to return { fallthrough: true } and kit will process the next route, [project], in this case.

However it doesn't work when you use endpoints shadowing the route. It works as expected when using load() function within the svelte component file. It works on first render or full page refresh. However it breaks when navigating. SvelteKit somehow gets stuck on [page]/index.svelte component and renders itself instead of falling through to the next one.

Reproduction

https://github.com/lemmon/svelte-kit-fallthrough-endpoint-bug

Logs

No response

System Info

System:
    OS: macOS 11.6.3
    CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
    Memory: 203.37 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.1 - /usr/local/bin/node
    npm: 8.5.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 88.1.19.86
    Chrome: 98.0.4758.109
    Firefox: 97.0.1
    Safari: 15.3
  npmPackages:
    @sveltejs/adapter-auto: 1.0.0-next.30 => 1.0.0-next.30 
    @sveltejs/kit: 1.0.0-next.291 => 1.0.0-next.291 
    svelte: ^3.44.0 => 3.46.4

Severity

blocking an upgrade

Additional Information

No response

@dansvel
Copy link

dansvel commented Mar 4, 2022

is this same issue in #4038? and in progress to fix in #4203

@Rich-Harris
Copy link
Member

It's a duplicate, yes — fix will be merged soon, so I'll close this

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

3 participants