You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat!: import createNuxtContent from @nuxt/content/server - #3935
📖 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.
// v3 composables, imported by handimport{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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❓ Type of change
📚 Description
A v4 app imports
createNuxtContent()from@nuxt/content/appinapp/content.ts, but from@nuxt/content/contentinserver/content.ts. This moves the server one to@nuxt/content/server, so the paths match.@nuxt/content/serverexportscreateNuxtContent().@nuxt/content/contentis removed.queryCollection,queryCollectionNavigation,queryCollectionItemSurroundings,queryCollectionSearchSections) move from@nuxt/content/serverto@nuxt/content/v3/server. They're still auto-imported withcompatibilityVersion: 3.server/content.tsalias the new paths, so stubbed builds resolve them.migration.md,examples/hybrid-v4-pureand the fixtures use the new paths.Evidence
The
v3-page-defaultsfixture now importsqueryCollectionfrom@nuxt/content/v3/server. Before the module change, its test failed with"@nuxt/content/v3/server" ... could not be resolvedand 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/nitrodeprecation warning suggests, now fails at build with"queryCollection" is not exported. The fix is to import from@nuxt/content/v3/server, asmigration.mdsays. 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
v3in it.🤖 Generated with Amp, reviewed by @larbish before opening.