dulnan / nuxt-graphql-middleware

GraphQL in the backend, fetch in the frontend. With TypeScript support.
https://nuxt-graphql-middleware.dulnan.net
MIT License
57 stars 11 forks source link

Cannot find module 'nuxt-graphql-middleware/dist/runtime/serverOptions' or its corresponding type declarations. #22

Closed Applelo closed 4 months ago

Applelo commented 9 months ago

When I do an import of this function 'import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/dist/runtime/serverOptions', typescript is throwing the following error: Cannot find module 'nuxt-graphql-middleware/dist/runtime/serverOptions' or its corresponding type declarations.

I think it is related to "moduleResolution": "Bundler" added in nuxt with typescript 5 (see https://publint.dev/rules#types_not_exported).

[EDIT] It was activated since Nuxt 3.10 here https://nuxt.com/blog/v3-10#bundler-module-resolution. Reproduction: https://stackblitz.com/edit/graphql-middleware-typing-issue?file=app%2FgraphqlMiddleware.serverOptions.ts

dulnan commented 8 months ago

Thank you for providing the PR with the fix! I'll do a release soon with the fix.