You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/pajecawav/next-ofetch-edge-api-route
cd next-ofetch-edge-api-route
pnpm install
pnpm build
Describe the bug
Starting from next@13.1.7-canary.17 I can't use ofetch inside an Edge API route because build fails with an error "Module build failed: UnhandledSchemeError: Reading from "node:buffer" is not handled by plugins (Unhandled scheme).".
After some digging I figured out that most likely changes in this PR caused the issue.
I managed to get it working by removing "node" section from "exports" field in the package.json of ofetch:
Thanks for reporting this. Let me do some more research how reliable is this new condition. FYI we had been thinking to introduce similar condition for Nitro/Nuxt (nitrojs/nitro#1123)
pi0
changed the title
Incompatibility with Next.js Edge API runtime
Incompatibility with Next.js Edge API runtime using edge-light condition
May 8, 2023
pajecawav
added a commit
to pajecawav/ghloc-web
that referenced
this issue
May 20, 2023
Environment
ofetch: v1.0.1
next: from v13.1.7-canary.17 to v13.4.1
node: v18.15.0
Reproduction
https://github.com/pajecawav/next-ofetch-edge-api-route
To reproduce:
git clone https://github.com/pajecawav/next-ofetch-edge-api-route cd next-ofetch-edge-api-route pnpm install pnpm build
Describe the bug
Starting from next@13.1.7-canary.17 I can't use
ofetch
inside an Edge API route because build fails with an error"Module build failed: UnhandledSchemeError: Reading from "node:buffer" is not handled by plugins (Unhandled scheme)."
.After some digging I figured out that most likely changes in this PR caused the issue.
I managed to get it working by removing
"node"
section from"exports"
field in thepackage.json
ofofetch
:Adding
"edge-light"
also seems to fix the issue:Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: