levinunnink / html-form-to-google-sheet

How to submit HTML forms to Google Sheets. (Updated for 2024 Script Editor)
https://sheetmonkey.io
MIT License
839 stars 154 forks source link

CORS Block happen #27

Open lakminagamage opened 9 months ago

lakminagamage commented 9 months ago

Describe the bug I followed all the given guide and now its returning me an error.

_Access to fetch at 'https://script.google.com/macros/s/AKfycbyKEXa4GFAV60DeRC-8eMmlgbLOK1BU40FzS4oaEL7dlb2nCgT_WG17a-nDGPvOccpPXA/exec' from origin 'https://ordereka.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled_

To Reproduce Steps to reproduce the behavior: 1.same as given guide. Expected behavior Should update the google sheet

Screenshots

image

Desktop (please complete the following information):

ninbit commented 9 months ago

if you use doGet, try using doPost.

harshilsharma63 commented 6 months ago

Are you making the request manually or it the default form submittion? It works fine for me both ways. Try setting mode to no-cors. That worked for me.

yashi-15 commented 2 months ago

Describe the bug I followed all the given guide and now its returning me an error.

_Access to fetch at 'https://script.google.com/macros/s/AKfycbyKEXa4GFAV60DeRC-8eMmlgbLOK1BU40FzS4oaEL7dlb2nCgT_WG17a-nDGPvOccpPXA/exec' from origin 'https://ordereka.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled_

To Reproduce Steps to reproduce the behavior: 1.same as given guide. Expected behavior Should update the google sheet

Screenshots image

Desktop (please complete the following information):

  • OS: MACOS
  • Browser: Brave

Hey, I am getting the same issue and even setting mode to no-cors is not solving the problem. Do you have any solution?