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

Adjacent folder fallthrough pages swallow endpoint request #1512

Closed
adamjkb opened this issue May 20, 2021 · 1 comment
Closed

Adjacent folder fallthrough pages swallow endpoint request #1512

adamjkb opened this issue May 20, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@adamjkb
Copy link
Contributor

adamjkb commented May 20, 2021

Describe the bug
The following routes folder structure will result in page /b being a 404 however /b.json is reachable when requested directly. (Both [a].svelte and [b].svelte try to fetch their respective endpoint from the load function.)
The issue only comes up when the address is accessed directly; navigating to /b is still working (see root page).

├── [a]
│   ├── index.json.js
│   └── index.svelte
├── [b]
│   ├── index.json.js
│   └── index.svelte
└── index.svelte

The same routes flattened as such will work as expected:

├── [c].json.js
├── [c].svelte
├── [d].json.js
├── [d].svelte
└── index.svelte

Logs
Retracing /b request by logging paths from each endpoint and page:

Page A (/b)
Endpoint A (/b.json)
Page B (/b)
Endpoint A (/b.json)
Page A (/b.json)
Endpoint A (/b.json.json)

To Reproduce
Repo: https://github.com/adamjkb/sveltekit-adjacent-fallthrough-routes

Type localhost:3000/b in address bar.

Expected behavior
To reach all endpoints/pages if its requirements are met.

Severity
Low–medium. Has work around.

@benmccann benmccann added the bug Something isn't working label May 22, 2021
@benmccann benmccann added this to the 1.0 milestone May 22, 2021
@adamjkb
Copy link
Contributor Author

adamjkb commented Aug 3, 2021

Closing as this has been fixed alongside of #2041

@adamjkb adamjkb closed this as completed Aug 3, 2021
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

2 participants