Skip to content

feat!: import createNuxtContent from @nuxt/content/server - #3935

Open
larbish wants to merge 1 commit into
v4from
feat/server-import-path
Open

larbish wants to merge 1 commit into
v4from
feat/server-import-path

Conversation

@larbish

@larbish larbish commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

A v4 app imports createNuxtContent() from @nuxt/content/app in app/content.ts, but from @nuxt/content/content in server/content.ts. This moves the server one to @nuxt/content/server, so the paths match.

  • @nuxt/content/server exports createNuxtContent(). @nuxt/content/content is removed.
  • The v3 server composables (queryCollection, queryCollectionNavigation, queryCollectionItemSurroundings, queryCollectionSearchSections) move from @nuxt/content/server to @nuxt/content/v3/server. They're still auto-imported with compatibilityVersion: 3.
  • Nitro and the build-time loader of server/content.ts alias the new paths, so stubbed builds resolve them.
  • migration.md, examples/hybrid-v4-pure and the fixtures use the new paths.
// server/content.ts
import { createNuxtContent } from '@nuxt/content/server'
// v3 composables, imported by hand
import { queryCollection } from '@nuxt/content/v3/server'
  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Evidence

The v3-page-defaults fixture now imports queryCollection from @nuxt/content/v3/server. Before the module change, its test failed with "@nuxt/content/v3/server" ... could not be resolved and a 500 on /api/pages. It passes now. The whole suite passes locally (28 files, 112 tests), as do lint and typecheck.

Notes

A v3 app that imports the composables by hand from @nuxt/content/server, as v3's @nuxt/content/nitro deprecation warning suggests, now fails at build with "queryCollection" is not exported. The fix is to import from @nuxt/content/v3/server, as migration.md says. Apps that use the auto-imports aren't affected.

ELI5

The setup file for the server now imports from a path named after the server, like the browser one is named after the app. The older helper functions from version 3 moved to a path with v3 in it.

🤖 Generated with Amp, reviewed by @larbish before opening.

@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
content Error Error Nov 27, 2026 9:51pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The package export map and runtime aliases now separate @nuxt/content/server from @nuxt/content/v3/server. The migration guide, comments, examples, and test fixtures use the updated import paths. The content configuration in the affected examples remains unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 27e32

This change moves the server import paths as documented in the migration guide. Auto-imports are unaffected, and the examples and fixtures use the new paths. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the server-side createNuxtContent import now comes from @nuxt/content/server. It matches the objectives and the file changes. It is a breaking change, and the feat! pr…
Description check Passed The description states the change: the server content.ts import moves to @nuxt/content/server, and the v3 composables move to @nuxt/content/v3/server. It also covers the breaking impact, migration not…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the server-side createNuxtContent import now comes from @nuxt/content/server. It matches the objectives and the file changes. It is a breaking change, and the feat! prefix signals that. The title is short, specific, and in one sentence.

Full details: Description check

Explanation

The description states the change: the server content.ts import moves to @nuxt/content/server, and the v3 composables move to @nuxt/content/v3/server. It also covers the breaking impact, migration notes, and test evidence. It matches the changeset closely.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 72a8f32a-15c6-45e0-83d8-da97da2da4bf
Commits

Reviewing files that changed from the base of the PR and between 50232f9 and 27e3201.

Files selected for processing: 9

  • examples/hybrid-v4-pure/server/content.ts
  • migration.md
  • package.json
  • src/module.ts
  • src/runtime/client-content/app.ts
  • src/utils/config.ts
  • test/fixtures/app-content/server/content.ts
  • test/fixtures/layer-sources/docs-layer/server/content.ts
  • test/fixtures/v3-page-defaults/server/api/pages.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@larbish
larbish requested a review from farnabaz November 27, 2026 21:56
@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/content@3935

commit: 27e3201

This branch had an error being deployed

1 failed deployment
Preview — 27e32010 Deployed Nov 27, 2026 by vercel[bot]
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.

1 participant