riffusion-app icon indicating copy to clipboard operation
riffusion-app copied to clipboard

AbortSignal is not defined

Open DaemonAlchemist opened this issue 3 years ago • 3 comments

I'm getting a 500 error when I try to run any prompt. The console error log shows that AbortSignal is not defined:

error - (api)\pages\api\server.js (11:12) @ handler error - ReferenceError: AbortSignal is not defined at handler (webpack-internal:///(api)/./pages/api/server.js:14:17) at Object.apiResolver (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\api-utils\node.js:367:15) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:95:5) at async DevServer.runApi (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\next-server.js:474:9) at async Object.fn (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\next-server.js:736:37) at async Router.execute (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\router.js:252:36) at async DevServer.run (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\base-server.js:384:29) at async DevServer.run (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\dev\next-dev-server.js:732:20) at async DevServer.handleRequest (C:\Users\andrea\Desktop\Riffusion\web-app\node_modules\next\dist\server\base-server.js:322:20) { page: '/api/server' } 9 | headers: headers, 10 | body: req.body,

11 | signal: AbortSignal.timeout(15000), | ^ 12 | }); 13 | 14 | const data = await response.json();

DaemonAlchemist avatar Dec 16 '22 17:12 DaemonAlchemist

We may need to change the routes to use AbortController to handle the timeout if AbortSignal is not supported on your browser? Or add the polyfill in this post: https://stackoverflow.com/a/50101022/901553

Can you try it?

hmartiro avatar Dec 16 '22 19:12 hmartiro

Haven't had a chance to try the polyfill yet, but I get the same error in the most recent versions of both Chrome and Firefox.

DaemonAlchemist avatar Dec 16 '22 23:12 DaemonAlchemist

Upgrading Node seems to have fixed the error. It would be good to include the minimum required version of Node in the dependencies and/or installation instructions.

DaemonAlchemist avatar Dec 17 '22 01:12 DaemonAlchemist

Done in #23, duplicate with #8

hmartiro avatar Dec 19 '22 06:12 hmartiro