Skip to content

Prerendering with +server.js blocks cURL requests #10102

@dextermb

Description

@dextermb

Describe the bug

When attempting to cURL a preview build of SvelteKit that uses prerender within a +server.js file a 405 Method not allowed is returned. However when providing an extra "Accept" header 200 OK is returned, and when using +page.server.js instead a 200 OK is returned.

Example repository linked below.

Reproduction

https://github.com/dextermb/svelte-kit-prerender-405-server-js

Logs

No response

System Info

npx envinfo --system --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"
Need to install the following packages:
  envinfo@7.8.1
Ok to proceed? (y) y

  System:
    OS: macOS 13.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 79.95 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Firefox: 110.0.1
    Safari: 16.5

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions