🐛 BUG: SvelteKit Still Had Null Body Response Error
See original GitHub issueWhat version of Wrangler
are you using?
0.0.15
What operating system are you using?
Windows
Describe the Bug
SvelteKit still gets null body response error which was fixed in https://github.com/cloudflare/miniflare/releases/tag/v2.0.0-rc.3, not sure how Wrangler2 incorporates miniflare, is there a pending version update or is this a separate issue?
SETUP
npm init svelte@next my-app
npm i --save-dev @sveltejs/adapter-cloudflare@next
Update svelte.config.js to use adapter.
npm install
LAUNCH
npx wrangler pages dev --proxy 3000 -- npx svelte-kit dev --host
ERROR
When viewing project on _http://localhost:8788/_ page will alternate between rendering correctly and showing this:
BEHAVIOR When viewing same page with network tab open and disable cache enabled, error does not occur
Output:
[pages:err] GET /: TypeError: Response with null body status cannot have body
at new Response (E:\Programming\Projects\ArtPageSvelteWrangler\node_modules\undici\lib\fetch\response.js:160:15)
at new Response (E:\Programming\Projects\ArtPageSvelteWrangler\node_modules\@miniflare\core\src\standards\http.ts:556:13)
at Object.construct (E:\Programming\Projects\ArtPageSvelteWrangler\node_modules\@miniflare\core\src\plugins\core.ts:69:29)
at Object.fetch (<script>:5:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at EventTarget.[kDispatchFetch] (E:\Programming\Projects\ArtPageSvelteWrangler\node_modules\@miniflare\core\src\standards\event.ts:359:13)
at Server.<anonymous> (E:\Programming\Projects\ArtPageSvelteWrangler\node_modules\@miniflare\http-server\src\index.ts:167:20)
GET / 500 Internal Server Error (22.61ms)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Errors • Docs • SvelteKit
If an error occurs inside handle or inside a +server.js request handler, SvelteKit will respond with either a fallback error page or a...
Read more >How to write tests in Sveltekit and Vitest - Eternal Dev
We will learn about setting up Sveltekit and Vitest for writing tests ... component that will have the loading, success, and error states....
Read more >Unable to access request.body from the endpoint.js in sveltekit ...
When I add const data = await request.json(), when compile using npm run dev, I get an error that request.json() is not a...
Read more >Recommended - SlideShare
Routing At the heart of SvelteKit is a filesystem-based router. The routes of. +page.js Often, a page will need to load some data...
Read more >General | ʻenehana – Hekili Tech
To start, i made the simple component, which would have an ... Less bloat == less bugs. ... npm init svelte nhost-sveltekit-auth-test cd ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve found the issue. The problem is in the Miniflare proxy. @GregBrimble is working on a fix. In the meantime, you can (sort of) workaround this by building the Svelte app and then running the build output via pages directly…
Fix here: https://github.com/cloudflare/miniflare/pull/172