Hi guys
It looks like this code can’t be used when the app is build with Edgio.
const response = await fetch(url);
const reader = response.body?.getReader();
The above code is working when the app is build with NextJS.
Steps to reproduce:
- Clone the repo GitHub - petrvecera/next_test
- yarn install, yarn build, yarn start
- Navigate to http://127.0.0.1:3000/api/hello , it works
edg build && edg run -p
- Navigate to http://127.0.0.1:3000/api/hello , it crashes
Full error:
TypeError: t.body?.getReader is not a function
at u (C:\Git\other\nextnext-app\.edgio\lambda\app\.next\server\pages\api\hello.js:1:563)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async d (C:\Git\other\nextnext-app\.edgio\lambda\app\.next\server\pages\api\hello.js:1:848)
at async K (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\compiled\next-server\pages-api.runtime.prod.js:20:16853)
at async U.render (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\compiled\next-server\pages-api.runtime.prod.js:20:17492)
at async NextNodeServer.runApi (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\server\next-server.js:600:9)
at async NextNodeServer.handleCatchallRenderRequest (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\server\next-server.js:269:37)
at async NextNodeServer.handleRequestImpl (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\server\base-server.js:816:17)
at async invokeRender (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\server\lib\router-server.js:174:21)
at async handleRequest (C:\Git\other\nextnext-app\.edgio\lambda\app\node_modules\next\dist\server\lib\router-server.js:353:24)