Open markhughes opened 1 year ago
Can we get more eyes on @BlakeThomson-at! This is a blocker for us!
Man... I spent entire day trying to fix that... Is there any temporary solution? Here's repository reproducing the problem: delasy/airtable-nextjs-malformed-url
Here is how you can get around it. I would suggest not using Airtable as their dev relations is terrible, I have tried many avenues to poke them about this.
patch-package
(yarn patch-package
, npx patch-package
, etc..)patch-package
to your postinstall
for package.json
The next.js edge runtime does a validation on the Request object.
This causes this line to fail:
https://github.com/Airtable/airtable.js/blob/b468d8fe48d75e3d5fe46d0ea7770f4658951ed0/src/abort-controller.ts#L7
As it is considered an invalid URL. We should pass a valid URL here for this validation.
You can see here in the edge runtime it adds its own validator:
https://github.com/vercel/next.js/blob/efcec4c1e303848a5293cef6961be8f73fd5160b/packages/next/src/server/web/sandbox/context.ts#L267-L279
Which will not accept an invalid URL:
https://github.com/vercel/next.js/blob/efcec4c1e303848a5293cef6961be8f73fd5160b/packages/next/src/server/web/utils.ts#L108-L119