You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using fetch on a server route, that is pre-rendered (export const prerender = true), the operation fails with a message of not found. It can't be requested externally either ie. through the browser. This only occurs when using the built version.
TypeError: fetch failed
at fetch (file:///home/httpswwwsveltelabdev-n1l0/node_modules/undici/index.js:109:13)
at async resolve (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:2663:14)
at async respond (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:2529:22)
at async fetch (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:2291:20)
at async Object.eval [as fetch] (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:2230:12)
at async load (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/entries/pages/_page.server.js:15:15)
at async load_server_data (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:540:18)
at async eval (file://file:///home/httpswwwsveltelabdev-n1l0/.svelte-kit/output/server/index.js:1900:18) {
cause: HTTPParserError: Response does not match the HTTP/1.1 protocol (Content-Length can't be present with Transfer-Encoding) at Parser.execute (file:///home/httpswwwsveltelabdev-n1l0/node_modules/undici/lib/client.js:577:15) at Parser.readMore (file:///home/httpswwwsveltelabdev-n1l0/node_modules/undici/lib/client.js:518:12) at Socket.onSocketReadable (file:///home/httpswwwsveltelabdev-n1l0/node_modules/undici/lib/client.js:945:10) at EventEmitter.emit (https://httpswwwsveltelabdev-n1l0.w-corp.staticblitz.com/blitz.9c8944bc.js:35:156830) at emitReadable_ (https://httpswwwsveltelabdev-n1l0.w-corp.staticblitz.com/blitz.9c8944bc.js:35:729152) at _0xe8552e (https://httpswwwsveltelabdev-n1l0.w-corp.staticblitz.com/blitz.9c8944bc.js:44:152768) at https://httpswwwsveltelabdev-n1l0.w-corp.staticblitz.com/blitz.9c8944bc.js:44:152515 { code: 'HPE_UNEXPECTED_CONTENT_LENGTH', data: '{"data":"Test Data"}' }}
Okay I'm sorry, this seems to be my fault. The error seems to be something else. Even tho we did have some issues on the discord server, this probably doesn't have anything to do with it. Although, I did have this problem, it seems to have been solved by some experimentation. Sorry for all the confusion, for stealing a pretty cool issue number and wasting your time. I love you all.
I will now close the issue, and please don't stone me to death, even tho I probably deserve it.
Describe the bug
When using
fetch
on a server route, that is pre-rendered (export const prerender = true
), the operation fails with a message of not found. It can't be requested externally either ie. through the browser. This only occurs when using the built version.Reproduction
https://www.sveltelab.dev/s3p4ypow5f1hy0u
Run using
Logs
System Info
Severity
serious, but I can work around it
Additional Information
This was already an issue that was apparently resolved
#8341
#8039
#8331
Supposed to be fixed in #8453
Also discussed on the discord server.
The text was updated successfully, but these errors were encountered: