Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify: Request with GET/HEAD method cannot have body #3438

Closed
mattpilott opened this issue Jan 20, 2022 · 8 comments · Fixed by #3459
Closed

Netlify: Request with GET/HEAD method cannot have body #3438

mattpilott opened this issue Jan 20, 2022 · 8 comments · Fixed by #3459
Labels
bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.

Comments

@mattpilott
Copy link

mattpilott commented Jan 20, 2022

Describe the bug

Hello,

I updated to kit 234 & auto adapter 13 this morning and upon deploying to netlify I ran into the attached issue.

After asking in discord and trying a few things i have been unable to resolve it.

I then created a reproduction using the skeleton starter and managed to confirm the issue again. This may very well be down to a breaking change in #3384

Happy to give more info if need be!

Reproduction

https://github.com/mattpilott/kit

https://kittest.netlify.app

Logs

{
  "errorType": "TypeError",
  "errorMessage": "Request with GET/HEAD method cannot have body",
  "trace": [
    "TypeError: Request with GET/HEAD method cannot have body",
    "    at new Request2 (/var/task/.netlify/functions-internal/render.js:5262:17)",
    "    at Runtime.handler (/var/task/.netlify/functions-internal/render.js:7048:39)",
    "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
  ]
}

System Info

System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1
    Memory: 76.42 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.3.1 - /opt/homebrew/bin/node
    npm: 8.3.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 97.0.4692.71
    Firefox: 96.0.1
    Safari: 15.2
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.13 
    @sveltejs/kit: next => 1.0.0-next.234 
    svelte: ^3.44.0 => 3.46.2

Severity

blocking an upgrade

Additional Information

No response

@ignatiusmb ignatiusmb added bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc. labels Jan 20, 2022
@thisisthejay
Copy link

I'm getting the same issue on my deploy https://confident-perlman-901dcd.netlify.app

@dimavolo
Copy link

I got the same issue after following the resolution steps in #2687

@mattpilott
Copy link
Author

@dimavolo You can downgrade to kit 233 and auto-adapter 12 (netlify adapter 40)

@dimavolo
Copy link

@dimavolo You can downgrade to kit 233 and auto-adapter 12 (netlify adapter 40)

Thanks for the suggestion. I gave that a go, but that now reverts to my original error: SyntaxError: Unexpected token '.'

https://61e987875ecd5f0007e9b0aa--excel-demo-012.netlify.app

Are these two issues (i.e. optional chaining vs. "Request with GET/HEAD method cannot have body") connected or quite separate?

@dimavolo
Copy link

dimavolo commented Jan 20, 2022

Oops, I see my dependencies didn't downgrade as you had suggested. I'll try again.

"devDependencies": {
		"@babel/core": "^7.16.10",
		"@babel/preset-env": "^7.16.10",
		"@sveltejs/adapter-auto": "next",
		"@sveltejs/adapter-netlify": "^1.0.0-next.40",
		"@sveltejs/kit": "^1.0.0-next.235",
		"@tailwindcss/forms": "^0.4.0",
		"@tailwindcss/typography": "^0.5.0",

@mattpilott
Copy link
Author

mattpilott commented Jan 20, 2022

Im not sure, cant see how they would be. Have you tried setting a NODE_VERSION env variable in netlify?

NODE_VERSION = node

Might be that you need node 17

@dimavolo
Copy link

dimavolo commented Jan 20, 2022

I've tried all these variations:

  1. Setting NODE_VERSION env variable in Netlify Dashboard UI to 14 and 16 (but not 17)

  2. Setting Node version in netlify.toml to 14 and 16 (but not 17)

  3. Setting netlify.toml:

[build.environment]
  AWS_LAMBDA_JS_RUNTIME = "nodejs14.x"
  1. Setting netlify.toml:
[functions]
  node_bundler = "esbuild"

Currently my package.json has:


"devDependencies": {
		"@babel/core": "^7.16.10",
		"@babel/preset-env": "^7.16.10",
		"@sveltejs/adapter-auto": "1.0.0-next.12",
		"@sveltejs/adapter-netlify": "^1.0.0-next.40",
		"@sveltejs/kit": "^1.0.0-next.233",
		"@tailwindcss/forms": "^0.4.0",

Currently Netlify env in the UI has only:

AWS_LAMBDA_JS_RUNTIME = nodejs14.x

My deploy is here: https://61e989e221b6fd00070a45cd--excel-demo-012.netlify.app

@mattpilott
Copy link
Author

mattpilott commented Jan 20, 2022

Screenshot 2022-01-20 at 4 10 44 pm

Try this one

Also you dont need adapter auto and netlify one or the other is fine

I dont think your issue is related to this one btw, maybe it should be its own ticket if you cant resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p1-important SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants