-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
internal component ProseCode class attribute seems to be not working #2111
Comments
Inline code highlight maybe enabled with
This warning happens because you don't use As for strange colors in your code block: you changes theme, but not background. Solution is to properly use dark modes (like I did, for example) As a result, this is not problems of @nuxt/content, but your setup I'm lucky man, because I define all I want by myself and can widely control stuff .prose :where(pre):not(:where([class~="not-prose"] *)) {} This selector applies dark background and comes from your tailwind.css |
I have a fresh doc-driven project here: https://stackblitz.com/edit/github-gfxckn?file=nuxt.config.ts The Vue warn is there in both cases. |
I have the same [Vue warn]: Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
at <ProseCode class="language-html" code="<p>code styling is easy</p>\n" filename="my-first-blog-post.md" ... > |
I try to define the props file: components->content->ProseCode.vue props: {
...otherProps,
class: {
type: String,
default: "",
}
} |
@helltraitor The main problem is |
Yes, you are right. just adding a single root node should work fine. |
* Update dependencies to wanted * Update dev dependencies to latest * Update package.json * Define tsconfig for server * Workaround for type issue nuxt/content#2177 * Fix ProseCode warns nuxt/content#2111 * Fix internal links
@farnabaz this still happens in edge-channel. chunk-RAKT47ZN.js:1449 [Vue warn]: Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
at <ProseCode class="language-ts" code="let x: number = 0;\n" language="ts" ... >
... Edit: Never mind. Works fine with v2.8.2 |
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version. Currently, we're getting warnings in the form of " WARN [nuxt] Two component files resolving to the same name ProseP:" for all components we override. This should be fixed in an upcoming version of nuxt (nuxt/nuxt#22882).
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version. Currently, we're getting warnings in the form of " WARN [nuxt] Two component files resolving to the same name ProseP:" for all components we override. This should be fixed in an upcoming version of nuxt (nuxt/nuxt#22882).
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version. Currently, we're getting warnings in the form of " WARN [nuxt] Two component files resolving to the same name ProseP:" for all components we override. This should be fixed in an upcoming version of nuxt (nuxt/nuxt#22882).
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version. Currently, we're getting warnings in the form of " WARN [nuxt] Two component files resolving to the same name ProseP:" for all components we override. This should be fixed in an upcoming version of nuxt (nuxt/nuxt#22882).
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version. Currently, we're getting warnings in the form of " WARN [nuxt] Two component files resolving to the same name ProseP:" for all components we override. This should be fixed in an upcoming version of nuxt (nuxt/nuxt#22882).
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version.
Nuxt Content 2.8 fixes Vue warnings when rendering code (see also nuxt/content#2111). Update to this version.
Environment
Reproduction
We can the following warning
clone this repo
https://github.com/narasimhajupally/tailwind-nuxtjs-starter-blog
and go to route/blog/code-sample
you will see the warning [Vue warn] in the developer console.
Describe the bug
classes like
language-javascript
andlanguage-python
that are needed for syntax highlighting are not coming into effect.`Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: