jasonkuhrt / graphql-request

Minimal GraphQL client
MIT License
5.77k stars 307 forks source link

7 doesnt work on nextjs #840

Closed Daniel3711997 closed 2 months ago

Daniel3711997 commented 2 months ago

Description

node:fs/promises does not exists on browsers, nextjs (webpack) does not know how to bundle this

Module build failed: UnhandledSchemeError: Reading from "node:fs/promises" is not handled by plugins (Unhandled scheme). (NextJS)

carlosvq commented 2 months ago

I have the same problem, I tried searching on the Internet but I didn't find a solution.

tomachristian commented 2 months ago

Same problem, even when not using nextjs or whatever

ert78gb commented 2 months ago

The https://github.com/jasonkuhrt/graphql-request/blob/main/src/lib/prelude.ts used so many places. It imports the node:fs/promises https://github.com/jasonkuhrt/graphql-request/blob/c15f7f961e06c990400228f89cc16dc7380f697a/src/lib/prelude.ts#L187)

jasonkuhrt commented 2 months ago

Thanks @ert78gb, that helps. I will try to ship a fix on this soon (like today or next few days).