Skip to content

BUG: Error, Expected signal to be an instanceof AbortSignal #386

@bernatfortet

Description

@bernatfortet

I'm getting an error Expected signal to be an instanceof AbortSignal when doing any call, e.g. select
I assume, the same issue as #205, #204

I'm using next.js "next": "^13.5.2",
and using Airtable v0.12.2

After digging around I realized it's a node-fetch issues. I ended having to fork the library and edit many parts of it to make it work. Now I"m using my own version. Upgraded node-fetch and it was solved.

I think the issue is here. When doing next dev I'm not getting the issue, but when I'm serving or it's pushed to vercel I'm getting the issue. I think it's because it's not reaching the polyfill or something like that.

What would be the most helpful way to support the team in fixing this issue?

// istanbul ignore file
let AbortController: new () => AbortController;
const browserGlobal =
    typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : null; // self is the global in web workers
if (!browserGlobal) {
    AbortController = require('abort-controller');
} else if ('signal' in new Request('https://airtable.com')) {
    AbortController = browserGlobal.AbortController;
} else {
    const polyfill = require('abortcontroller-polyfill/dist/cjs-ponyfill');
    AbortController = polyfill.AbortController;
}

export default AbortController;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions