Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt Content 3.0 breaks Nuxt Layer file resolution #3020

Open
sei-jdshimkoski opened this issue Jan 22, 2025 · 6 comments
Open

Nuxt Content 3.0 breaks Nuxt Layer file resolution #3020

sei-jdshimkoski opened this issue Jan 22, 2025 · 6 comments
Labels

Comments

@sei-jdshimkoski
Copy link

sei-jdshimkoski commented Jan 22, 2025

Environment

Working directory:
1:15:52 PM
Nuxt project info: (copied to clipboard) nuxi 1:15:52 PM


  • Operating System: Darwin
  • Node Version: v22.11.0
  • Nuxt Version: 3.15.2
  • CLI Version: 3.20.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, modules, content, app, css, build, nitro, compatibilityDate
  • Runtime Modules: @nuxt/[email protected], @nuxtjs/[email protected]
  • Build Modules: -

👉 Report an issue: https://github.com/nuxt/nuxt/issues/new?template=bug-report.yml
👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new
👉 Read documentation: https://nuxt.com

Reproduction

  1. Initialize Nuxt Layer Starter Template: npx nuxi init --template layer nuxt-layer
  2. Add Nuxt Content: npm install @nuxt/content
  3. Add Nuxt Content module to Nuxt Config:
export default defineNuxtConfig({
  ...
  modules: ['@nuxt/content']
  ...
})

When you run the app, notice that the settings found in .playground/app.config.ts are not overriding the settings from the root app.config.ts file. If you remove the Nuxt Content module from the Nuxt Config, everything works as expected.

This breaks tailwind.config.js from Nuxt Tailwind CSS as well.

Describe the bug

When you add Nuxt Content as a module when authoring a Nuxt Layer, it breaks file resolutions.

Examples of broken files:

app.config.ts
tailwind.config.js

Additional context

There doesn't seem to be an easy way to quickly create reproductions for Nuxt Layers that I could find. That is why the reproduction is more manual in nature.

Logs

@sei-jdshimkoski
Copy link
Author

On a related note, the Nuxt Content example on the Nuxt Tailwind CSS website is completely broken:

https://tailwindcss.nuxtjs.org/examples/content

@forinda
Copy link

forinda commented Jan 23, 2025

On this I am getting this log

 WARN  [nuxt] Failed to stringify dev server logs. Received DevalueError: Cannot stringify a function. You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/api/composables/use-nuxt-app#payload.


 WARN  [Vue warn]: Failed to resolve component: ContentDoc
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. 
  at <[...slug] onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <Anonymous key="/blog/some" vnode= { __v_isVNode: true,
  __v_skip: true,
  type:
   { setup: [Function (anonymous)],
     ssrRender: [Function: _sfc_ssrRender],
     __file: '/home/orinda/Desktop/vite-content/pages/blog/[...slug].vue' },
  props:
   { onVnodeUnmounted: [Function: onVnodeUnmounted],
     ref:
      RefImpl {
        dep: [Dep],
        __v_isRef: true,
        __v_isShallow: false,
        _rawValue: undefined,
        _value: undefined } },
  key: null,
 
 WARN  [nuxt] Failed to stringify dev server logs. Received DevalueError: Cannot stringify a function. You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/api/composables/use-nuxt-app#payload.

Seems like going back to lower version <3.x.x seems to be working

@farnabaz
Copy link
Member

This is due to a side-effect of Nuxt Content v3. And fixed by b4e7dec

Until next release, you can try using the commit release

npm i https://pkg.pr.new/@nuxt/content@b4e7dec

@forinda
Copy link

forinda commented Jan 23, 2025

I used the lower version <3of it and it's working. It could not even load the <ContentDoc/> component. If it's fixed then it's great news :)

@farnabaz farnabaz added the v3 label Jan 23, 2025
@sei-jdshimkoski
Copy link
Author

I used the lower version <3of it and it's working. It could not even load the <ContentDoc/> component. If it's fixed then it's great news :)

ContentDoc has been removed in Nuxt Content 3. Its no longer supported: https://content.nuxt.com/docs/getting-started/migration#components

The issue found in this ticket is different.

@vernaillen
Copy link

This is due to a side-effect of Nuxt Content v3. And fixed by b4e7dec

Until next release, you can try using the commit release

npm i https://pkg.pr.new/@nuxt/content@b4e7dec

I noticed that Nuxt Content v3 breaks Nuxt UI Pro 1.x.x. I assume that's caused by the same issue, as Nuxt UI Pro is loaded as a layer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants