Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
341 stars 42 forks source link

error TS2307: Cannot find module 'graphql-request/dist/types.dom' or its corresponding type declarations #339

Closed some-user123 closed 11 months ago

some-user123 commented 1 year ago

Environment


Describe the bug

I'm using shamefully-hoist=true as recommended by nuxt. As soon as I install the latest graphql-request package (6.1.0) in my project, nuxt/nuxt-graphql-client won't work any more as it seems to rely on graphql-request@5.0.0:

> nuxi generate

Nuxi 3.5.3                                                                                                                                                                               13:05:35
Nuxt 3.5.3 with Nitro 2.4.1                                                                                                                                                              13:05:35

 WARN  Using experimental payload extraction for full-static output. You can opt-out by setting experimental.payloadExtraction to false.                                                 13:05:40  

ℹ Building client...                                                                                                                                                                     13:05:54
ℹ vite v4.3.9 building for production...                                                                                                                                                 13:05:55
transforming (802) node_modules\.pnpm\graphql@16.6.0\node_modules\graphql\jsutils\memoize3.mjs.nuxt/gql/default.ts:2:27 - error TS2307: Cannot find module 'graphql-request/dist/types.dom' or its corresponding type declarations.

2 import type * as Dom from 'graphql-request/dist/types.dom';
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in .nuxt/gql/default.ts:2

ℹ ✓ 820 modules transformed.                                                                                                                                                             13:06:16  
 ELIFECYCLE  Command failed with exit code 2.

This workaround https://github.com/jasonkuhrt/graphql-request/issues/491#issuecomment-1524680873 doesn't help.

Might be related: https://github.com/dotansimha/graphql-code-generator-community/issues/501

Expected behaviour

Nuxt + nuxt-graphql-client should still work ;-)

Reproduction

No response

Additional context

No response

Logs

No response