AbortController errors after update

I just updated my dependencies and I started getting this error while rendering the app with fastboot:

ReferenceError: AbortController is not defined

Does anyone knows how to fix it? I checked my package folder from “dist” and it looks like the node polyfill is added as a dependency:

  "dependencies": {
    "abortcontroller-polyfill": "^1.7.3",
    "express-prom-bundle": "^6.6.0",
    "fastboot-app-server": "^4.1.1",
    "najax": "^1.0.7",
    "node-fetch": "^2.6.1",
    "prom-client": "^14.2.0"
  },
1 Like

It’s a node global but you have to tell fastboot to expose it to node

I know, but how? Initially I assumed that fastboot is doing it by default, but it looks like it is not. Then I added

global.fetch = require('node-fetch');
require('abortcontroller-polyfill/dist/polyfill-patch-fetch');

to my server script and it still does not work

which node are you using?

you just need to register the sandbox globals Fastboot incompatible with modern state of the ecosystem · Issue #913 · ember-fastboot/ember-cli-fastboot · GitHub

1 Like