question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Netlify: Request with GET/HEAD method cannot have body

See original GitHub issue

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 https://github.com/sveltejs/kit/pull/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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

1reaction
dimavolocommented, 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

0reactions
mattpilottcommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

My POST request is failing with a 'Request with GET/HEAD ...
I've got my answer in the comments but just posting an answer just in case someone else is facing 'REQUEST WITH GET/HEAD METHOD'...
Read more >
Get started with the Netlify API
Use our REST API to interact with our platform. Learn the basics for using the API, instructions for deploying sites, and notes on...
Read more >
Can I send HTTP GET request with body from browser?
TypeError: HEAD or GET Request cannot have a body. Safari 12. TypeError: Request has method 'GET' and cannot have a body.
Read more >
HTTP Request Methods – Get vs Put vs Post Explained with ...
Client-server architecture; APIs. By the end of this article you'll have a good understanding of the functions of each request method. You'll ...
Read more >
Failed to execute 'fetch' on 'Window': Request with GET cannot ...
Resolutions steps and guidelines for error "Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have the body".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found