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

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

Closed
lukewarlow opened this issue Jun 2, 2021 · 4 comments
Labels
🐞 bug Something isn't working scope: ssr

Comments

@lukewarlow
Copy link

lukewarlow commented Jun 2, 2021

Version

3.1.0-beta.6
Edit: Still an issue as of 3.2.30

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.

<source
  media="(prefers-color-scheme: dark)"
  type="image/svg+xml"
  srcset="/img/code-white.svg" />

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.

<source
  media="(prefers-color-scheme: dark)"
  type="image/svg+xml"
  srcset="/img/generic-logo-white.svg" />

This is #3536 reopened as the commit to fix it hasn't worked. Apologies if I'm doing something wrong in my SSR code, but I do believe this is a bug.

@posva posva added scope: ssr 🐞 bug Something isn't working labels Jun 3, 2021
@posva
Copy link
Member

posva commented Jun 3, 2021

I updated the expected and actually happening based on what you explained. Edit it if that's not what you meant

@lukewarlow
Copy link
Author

I hate leaving comments like this but this bug is blocking me migrating a few sites over to SSR. I see there's a PR that's been open a while to address this issue, is there anything I can do to get that reviewed?

@edison1105
Copy link
Member

@lukewarlow
Let's pushing this. ping @yyx990803

@lukewarlow
Copy link
Author

Just tested on latest Vue and it's still reproducible.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: ssr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants