-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Make src/routes/index.anything.js
a compile error
#3751
Comments
I haven't confirmed myself, but it was also mentioned on Discord that this is an example from the docs, so the docs are currently broken |
The only reference I see to What path is |
I don't know how Also potentially adjacent is shadow endpoint stuff. If a GET endpoint has the same URL as a page, you can't request the endpoint unless you send |
@babichjacob beat me to part of this by a few seconds. I'd probably argue that |
routes/index.json.ts
cannot be reached if fetch
ed from routes/index.svelte
src/routes/index.anything.js
a compile error
Closing as no longer necessary as of #5748 |
Describe the bug
An endpoint with a filename of
routes/index.json.ts
cannot be reached using afetch
from aroutes/index.svelte
On the vite process I see a:
The server defaults to 500 and the fetch promise fails.
Using any other name for the endpoint (like
routes/other.json.ts
) and pointing thefetch
call to this new endpoint works as expected.This was introduced on a recent version of
@sveltejs/kit
as this does not happen on previous versions this can be observed on :1.0.0-next.260
Reproduction
npm init svelte@next my-app
"@sveltejs/kit": "1.0.0-next.260"
routes/index.json.ts
with a handler:routes/index.svelte
routes/index.json.ts
to something different likeroutes/other.json.ts
and adjust thefetch
call and it works as expectedLogs
System Info
Severity
serious, but I can work around it
Additional Information
Reported on the help #kit-help channel too
The text was updated successfully, but these errors were encountered: