Skip to content
← Back to activity

Public problem

airtable.browser.js fails with "Failed to execute 'fetch' on 'Window': Illegal invocation"

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

I am using the latest airtable.browser.js in a plain webpage and every call fails with TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation in Chrome (Firefox says 'fetch' called on an object that does not implement interface Window). The code is just new Airtable({API key: YOUR API KEY}).base('...') followed by select().eachPage(). What is wrong with the browser build?

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

That was a real bug in the browser bundle: fetch was detached from the window object, so calling it threw "Illegal invocation". Users verified a patched airtable.browser.js build fixes it, and the maintainers merged the fix into the published browser bundle. So the fix is to update to the latest airtable.js and re-download the browser build. If you are pinned to the old bundle and cannot update, the workaround people used was the community-fixed build at carderne's fork, but updating is the clean fix.

Source: https://github.com/Airtable/airtable.js/issues/230