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

Vite build generates srcset without space between source and resolution #3069

Closed
nsursock opened this issue Jan 20, 2021 · 2 comments · Fixed by #3132
Closed

Vite build generates srcset without space between source and resolution #3069

nsursock opened this issue Jan 20, 2021 · 2 comments · Fixed by #3132
Labels
🐞 bug Something isn't working scope: compiler

Comments

@nsursock
Copy link

Version

3.0.5

Reproduction link

https://github.com/nsursock/themusicstop-client

Steps to reproduce

Create a vite project, make a landing page with an srcset tag and try to deploy it on Netlify.
Example srcset :

<div class="lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2">
      <img class="h-56 w-full object-cover sm:h-72 md:h-96 lg:w-full lg:h-full" src="https://source.unsplash.com/1680x1050" alt="Random music picture from Unsplash"
        srcset="https://source.unsplash.com/1024x768 1024w, https://source.unsplash.com/1920x1280 1920w" sizes="(min-width: 800px) 1920px, 100vw">
    </div>

What is expected?

The page should load a different version of the image if you're on mobile or desktop.

What is actually happening?

The image doesn't load because in the dist folder, the app.js file removed the space between image source and resolution (eg https://source.unsplash.com/1024x768/?music1024w instead of https://source.unsplash.com/1024x768/?music 1024w).


I was trying to optimise my website for speed and used an srcset tag.

@posva
Copy link
Member

posva commented Jan 20, 2021

this seems to happen only with Vite but not with cli, please open an issue on Vite's repository https://github.com/vitejs/vite

@floorish
Copy link

floorish commented Feb 16, 2021

The issue on Vite's repository has been closed: "This is a Vue core (compiler-sfc) bug and will be tracked/fixed in the vue-next repo."
vitejs/vite#1626

Can this issue be reopened?

@posva posva reopened this Feb 16, 2021
@LinusBorg LinusBorg linked a pull request Feb 24, 2021 that will close this issue
@LinusBorg LinusBorg added 🐞 bug Something isn't working scope: compiler labels Feb 24, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 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: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants