Skip to content

VSCode shows error when adding plugin-graphql to Nuxt's nuxt.config.ts #1591

@sdr0x07b6

Description

@sdr0x07b6

nuxt.config.ts

import graphql from '@rollup/plugin-graphql'

export default defineNuxtConfig({
  ...

  vite: {
    // for Frontend
    plugins: [graphql()],
  },

  nitro: {
    rollupConfig: {
      // for Backend
      plugins: [graphql()],
    },
  },
});

When added in this way, it works fine in operation.
However, on the VSCode editor, an error is displayed at the graphql() point on the nitro side.

Type instantiation can be very deep and infinite. ts(2589)
(alias) graphql(options?: RollupGraphqlOptions | undefined): Plugin<any>
import graphql
Convert .gql/.graphql files to ES6 modules

Is this an error that only occurs with nuxt.config.ts?
How can I resolve this?

  • @rollup/plugin-graphql v2.0.3
  • Nuxt v3.7.3
  • Nodejs v18.18.0
  • macOS 13.5 Apple Silicon M2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions