Skip to content

fix(nuxt): support Nuxt 5 - #675

Open
onmax wants to merge 3 commits into
nuxt-modules:v5from
onmax:agent/nuxt-5-compat
Open

fix(nuxt): support Nuxt 5#675
onmax wants to merge 3 commits into
nuxt-modules:v5from
onmax:agent/nuxt-5-compat

Conversation

@onmax

@onmax onmax commented Jul 24, 2026

Copy link
Copy Markdown

🔗 Linked issue

N/A — this is a compatibility fix for Nuxt 5 consumers.

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This declares Nuxt 5 compatibility and makes GraphQL Vite plugin registration idempotent by plugin name.

Nuxt can extend separate client and SSR Vite configs over a shared plugin array, and another module or the consumer may already provide @rollup/plugin-graphql. Appending another graphql plugin makes the second transform parse the JavaScript emitted by the first as GraphQL. The module now reuses one plugin instance and only adds it when no graphql plugin is already registered.

The playground preloads the real GraphQL plugin as regression coverage. Before the name-based guard, pnpm dev:build fails on playground/queries/launches.gql with Syntax Error: Unexpected Name "var"; with the guard, both client and SSR builds pass.

✅ Checks

  • pnpm lint
  • pnpm build
  • pnpm dev:build (Nuxt 4.0.2 / Nitro 2.12.4)
  • Packed consumer build with nuxt-nightly@5.0.0-29762631.396a4ae3, @nuxt/kit-nightly@5.0.0-29762631.396a4ae3, Nitro 3.0.260610-beta, Vite 8.2.1, a real .gql import, and an existing graphql plugin

@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

👷 Deploy request for apollo-module pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2caf58c

@onmax
onmax marked this pull request as ready for review July 24, 2026 08:35
@onmax onmax changed the title fix: support Nuxt 5 fix(nuxt): support Nuxt 5 Aug 9, 2026
@Diizzayy Diizzayy self-assigned this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants