-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedPRs welcomed. The implementation details are unlikely to cause debatePRs welcomed. The implementation details are unlikely to cause debatep2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Milestone
Description
Describe the bug
Related to #3294. I don't think there's a situation in which it would make sense to have a non-GET request handler alongside a prerendered page.
In the same vein as #4093 (comment), SvelteKit should throw an error if a prerenderable page (either export const prerender = true, or config.kit.prerender.default = true without a export const prerenderable = false) has an endpoint with non-GET methods.
Reproduction
Add a non-GET method to any page endpoint and mark the page as prerenderable: https://stackblitz.com/edit/sveltejs-kit-template-default-8la3qs?file=src%2Froutes%2Fabout.js&terminal=dev
Logs
No response
System Info
System:
OS: macOS 12.0.1
CPU: (10) arm64 Apple M1 Max
Memory: 169.98 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
Browsers:
Chrome: 98.0.4758.109
Firefox: 97.0.1
Safari: 15.1
npmPackages:
svelte: ^3.43.0 => 3.44.2Severity
annoyance
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedPRs welcomed. The implementation details are unlikely to cause debatePRs welcomed. The implementation details are unlikely to cause debatep2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.