Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 26, 2026
This branch had an error being deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Warning
Draft for tracking what blocks Docus from moving to Nuxt Content v4. It's not meant to be merged. v4 is installed from local tarballs in
.content-v4/(git-excluded), so git-triggered builds fail. Previews are deployed from a local build withvercel build && vercel deploy --prebuilt.Preview: https://docus-kwyzk3nyw-nuxtlabs.vercel.app
This PR replaces
@nuxt/contentv3 with the Nuxt Content v4 POC (@nuxt/content4, nuxt/content-v4-temp@dbac272) through a pnpm override, without upgrading any other dependency. The checklists below are everything still missing upstream for Docus to run on v4 without any change on its side. Build-time workarounds live inlayer/modules/content-v4.ts, which does nothing on v3.This PR won't be merged, it's just here to try the compatibility mode of Nuxt Content v4
Nuxt Content v4
To define
[V4 fix or V4 Breaking change] Components in
components/content/aren't resolved, because v3 registered that folder globally without a prefix and v4 doesn't.:assistant-demorendered as a raw<assistant-demo>tag →content-v4.ts[V4 fix or V4 Breaking change]
#build/content/components.mjsnow only re-exports the app's own and global components. That drops the Nuxt UI components written in markdown (::u-page-hero,::u-page-card,::u-button…): they render as raw tags, the landing page breaks, and only 34 of 194 routes get prerendered. The workaround re-exports every component and loads them on demand →content-v4.ts[V4 fix or V4 Breaking change] Links in content are unstyled, because
ContentRendererhardcodesa: NuxtLink, which bypasses Nuxt UI'sProseA. External links also lose v3'srel="nofollow"→DocsContentLink.vue,[...slug].vue,landing.vue[V4 fix or V4 Breaking change] Frontmatter fields outside the schema are no longer under
meta, sositemap: falseandmodifiedAtwere ignored →urls.tsV4 fix
[V4 fix]
@sqlite.org/sqlite-wasmisn't a dependency, but the default hybrid mode needs it (v3 shipped it) →layer/package.json[Improve test to reproduce on Vercel] Runtime content queries hang on serverless. The server fetches its own snapshot (
/__nuxt_content/snapshot/<name>.json), which on Vercel only exists on the CDN, so the request reaches v4's/__nuxt_content/**handler and waits on itself until the 300 s timeout.mode: 'server-only'doesn't help: with a v3content.config.tsthe server instance is hard-coded tomode: 'hybrid', andserver-onlyalso stops the public snapshot from being generated →content-snapshot.ts,content-v4.ts·Tested on: nuxt/content-v4-temp#13
bodyis a bare node array instead of v3's{ type: 'minimark', value, toc }, so the page TOC is empty. The workaround rebuilds the TOC from the nodes the way@nuxtjs/mdcdid →toc.ts,DocsAsideRight.vueFixed on: nuxt/content-v4-temp#15
.navigation.ymlfiles are ignored, because the YAML plugin isn't registered in v3 mode, so folder titles and icons are lost. The workaround reads them at build time and merges them back into the navigation →content-v4.ts,navigation.ts·Fixed on: nuxt/content-v4-temp#11
[V4 fix]
queryCollection(event, 'missing')throws immediately instead of returning a rejected promise, so/api/__sitemap__/urlsreturned 500 at runtime when a collection doesn't exist →urls.ts[V4 fix] Only Markdown files are read in v3 mode.
.yml/.jsonfiles are skipped without a warning, because theyaml()/json()plugins aren't registered, and.csvhas no plugin at all. So v3datacollections in those formats come back empty. Docus doesn't define any, but users extending it can, and the.navigation.ymlworkaround above only patches the navigation.Fixed on: nuxt/content-v4-temp#11
/Users/…/docs/content) as a fallback source. It's unused while the snapshot loads, but if the snapshot ever fails to load, collections would likely come back empty instead of throwing an error. The local path also ships in the deployed function.Benchmark
Docus
[Docus usecase: just add shiki as deps] Code highlighting (nuxt/content-v4-temp#7, merged) makes
shikian optional peer that it only looks for in the app's own dependencies, so in a layer setup evennuxt preparecrashes withCannot resolve module "shiki". The workaround is a local fix that makes it a regular dependency resolved from the module →pnpm-workspace.yaml(locally patched tarball)[Docus will remove it] No
@nuxt/content/preview(field/group), sonuxt.schema.tsfailed to load. The workaround is a local copy of v3's helpers →preview.ts,nuxt.schema.tscomark / comark-content
stemis now relative to the collection folder andextensionis.mdinstead ofmd→content-v4.ts,[...slug].vue·Tested on: nuxt/content-v4-temp#12
comark-contentdoesn't coordinate index builds: concurrent first queries of a collection each rebuild its table, and one can drop it while another reads, so pages, navigation or prev/next links come back missing. v4's latestcomark-contentbuild (pkg.pr.new6708f9b) still needs the patch fromnuxt/content-v4-temp, so a published release with the fix is needed. The patch is already applied in the repacked tarball →pnpm-workspace.yamlFixed on: https://github.com/comarkdown/comark-content/pull/133
markdown/comarkoutput, which fixes themarkdown/htmlissues (escaped attributes likeclass="[&>div]:*:my-0", MDC slots inside HTML tags) and the nesting problems that motivated #1449. It's blocked by a serializer bug: a code sample that itself contains indented```fences is written with a three-backtick fence instead of four, so it closes early and the rest of the page is parsed as code (Steps example incomponents.md).nuxt-agent-discovery
[@benjamincanac nuxt-agent-discovery fix]
moduleDependenciespins@nuxt/contentto^3.0.0, so Nuxt refuses v4 →patches/nuxt-agent-discovery@0.7.0.patch[@benjamincanac nuxt-agent-discovery fix: should use comark-content way now for v4] The built-in Content source depends on v3 internals:
#content/manifest(not generated by v4),minimark/stringify(borrowed from@nuxt/content's dependencies) and v3'sbody.value. On v4 it should switch to the comark adapter wired to v4's servercontentby itself →layer/server/agent-source.ts,layer/nuxt.config.ts[@benjamincanac To investigate] With a custom source,
/sitemap.mdand/raw/index.mdaren't prerendered (they're served at runtime), sopnpm check:vercel-outputfails.Nuxt Studio
Plugin for collection json schema to generate frontmatter form / yaml forms
[Studio fix: inline compatibility functions] It imports
#content/preview(the v3 preview API),@nuxt/content/runtime(compressTree/decompressTree) and@nuxt/content/server, none of which v4 provides, so it can't build → disabled indocs/nuxt.config.tsNuxt UI
[@benjamincanac To investigate] Prose headings read
runtimeConfig.public.mdc.headings.anchorLinks, which@nuxtjs/mdcsets and v4 no longer installs. Heading anchors disappeared and inline code in headings lost its size →content-v4.ts[@benjamincanac To investigate] Highlight themes come from
@nuxtjs/mdcdefaults, so v4 used the GitHub themes instead of Nuxt UI'smaterial-theme-*→content-v4.ts🤖 Generated with Claude Code, reviewed by @larbish before opening.