Cross Domain Error on Localhost on Any Error in Google Apps Script

I noticed an odd-feeling error while playing with a frontend AJAX call from a localhost server that fetched data from a Google Sheet via a Google Apps Script middleware script.

Any time there was any kind of error in the Google Apps Script code. The JSON-P-based front end call was receiving this message (using the Chrome dev tools Console):

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://script.google.com/macros/s/-yourScriptID-/exec?action=rd with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.</code>

Technically, of course, it was a showing up as a CORS (Cross Domain Resource Sharing) or CORB (Cross Domain Read Blocking) error.

I bet the Google Apps Script error message automatically sends data back as HTML/Text and this is messing with the JSON-P callback, which is expecting the data type to be “javascript”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s