Render warning with nuxt
See original GitHub issueHello there, I have a problem when rendering svgs in my nuxt project. It always shows me the following warning in the browser console:
The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.
I am using the default config from the Readme file.
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/,
});
const vueRule = config.module.rules.find(rule => {
return rule.test.test('.vue');
});
vueRule.use = [
{
loader: vueRule.loader,
options: vueRule.options,
},
{
loader: 'vue-svg-inline-loader',
},
];
delete vueRule.loader;
delete vueRule.options;
}
},
},
Is there anything wrong with the configuration or am I just missing anything or is it supposed to be like that? Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Server Side Rendering - Nuxt
Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in...
Read more >Error handling · Get Started with Nuxt
Rendering an Error Page. When Nuxt encounters a fatal error, whether during the server lifecycle, or when rendering your Vue application (both SSR...
Read more >Nuxt App [Vue warn]:Component inside <Transition> renders ...
Nuxt App [Vue warn]:Component inside <Transition> renders non-element root node that cannot be animated. Save this question. Show activity on ...
Read more >[Vue warn]: The client-side rendered virtual DOM tree is not ...
[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example ......
Read more >API: The <client-only> Component - NuxtJS
Render a component only on client-side, and display a placeholder text on ... Warning: If you are using a version of Nuxt <...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
I finally figured what is going on. You have modified vue rule in condition
if (ctx.isDev && ctx.isClient) { /* ... */ }
, but it has to be outside. This resulted in nuxt not using loader in ssr. If you move the code outside that condition it will work.Please give feedback if it solved your issue.
Thanks
Glad to hear!