Vue-svg-loader: SVGs not rendered properly in SSR (nuxt.js)

Created on 17 Oct 2019  路  5Comments  路  Source: visualfanatic/vue-svg-loader

I have a few svgs that render perfectly when running nuxt.js in dev mode. They look like this:

image

When built with Nuxt using SSR, they render like this:

image

What are we doing wrong?

Most helpful comment

I am facing the same issue as well. In my production build style tags are getting stripped from the svg defs. Whereas development builds are working fine.

All 5 comments

Have you found a solution? If no, could you share those SVGs here?

I am facing the same issue as well. In my production build style tags are getting stripped from the svg defs. Whereas development builds are working fine.

@shivgarg5676 Did you find a solution? I passing through the same problem. :(

I manually inlined the styles.

It's an issue with SVGO https://github.com/svg/svgo/issues/1077
Try setting options: { svgo: { plugins: [{inlineStyles:{onlyMatchedOnce: false} }] } } or options: { svgo: { plugins: [{minifyStyles:false}] } } to vue-svg-loader and see if that solves the issue

If not and your svg is already optimized (which IMO it should be) you can set options: { svgo: false }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AtofStryker picture AtofStryker  路  3Comments

sashakaralchuk picture sashakaralchuk  路  6Comments

santigarcor picture santigarcor  路  8Comments

Mister-Hope picture Mister-Hope  路  3Comments

Chucheen picture Chucheen  路  5Comments