Subscribe on changes!

@vue/server-renderer renderToString generating incorrect srcset URL for source elements within a router link

avatar
Apr 2nd 2021

Version

3.0.11

Reproduction link

https://github.com/lukewarlow/vue-server-render-bug

Steps to reproduce

Clone the git repository. Run npm install and then npm run generate. This will generate a dist/static/index.html file. (One is already generated)

What is expected?

The generated html file should have two picture elements which point to different images in both the source element and the img element. As seen in the source file at src/views/Home.vue.

What is actually happening?

In dist/static/index.html you will be able to see that the img elements have different src values which is correct. But the source elements both have the same srcset value which is incorrect.

avatar
May 28th 2021

I've updated my test case to Vue 3.1.0-beta5 (https://github.com/lukewarlow/vue-server-render-bug) but I still experience the issue with incorrect srcset in the SSR output. Is there some change I need to make to my SSR code?