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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 BUG: SvelteKit Still Had Null Body Response Error #394
Comments
Thank you for reporting this, and sorry for the trouble! Could you try this with |
No trouble at all! All comes with the fun of using new things eh? Wrangler was updated to |
Well damn. Alright, we'll figure this out. Thanks again for the report! |
Don't know where it is, but this is because somewhere (either in wrangler or in SvelteKit), a Response is being constructed incorrectly. I've made the mistake myself several times before (usually when cloning an existing Response). This is what you need to do. |
Completely untested, but looks like it might be this line in SvelteKit: https://github.com/sveltejs/kit/blob/master/packages/adapter-cloudflare/files/worker.js#L17 |
Had a quick look at this. It seems that the Worker is returning a |
@GregBrimble - I tried changing that line but still got the error. From what I can make out it is miniflare that is dispatching the response, but I guess that is just being proxied from svelte? |
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... npm run build
npx wrangler pages dev .svelte-kit/cloudflare |
Fix here: cloudflare/miniflare#172 |
What 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
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:
The text was updated successfully, but these errors were encountered: