-
-
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
+server.ts must have a GET method or build fails #10735
Comments
You seem to have missed this error when you run your build:
Your Removing the link allows the build to succeed. |
But what if I want to include the link? |
The prerenderer crawls the root page |
Possibly related #10515 |
This seems to be the root cause.
This is enough to trigger the error. <!-- src/routes/+page.svelte --> // src/routes/+page.svelte
export const prerender = true; // src/routes/+server.ts
export const POST = () => new Response(null); In a new skeleton project, running
|
Describe the bug
In a route, I have a
+page.svelte
and+server.ts
file, and in the+server.ts
file I only have aPOST
method andexport const prerender = false
. When I build, it fails, but when I add an emptyGET
method, build runs perfectly fine.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-p5tugw?description=The%20default%20SvelteKit%20template,%20generated%20with%20create-svelte&file=src%2Froutes%2Fabout%2F%2Bserver.js&title=SvelteKit%20Default%20Template
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: