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

Unexpected warning while building transforming image-set urls with less #19304

Open
7 tasks done
GarreltMock opened this issue Jan 27, 2025 · 0 comments
Open
7 tasks done

Comments

@GarreltMock
Copy link

GarreltMock commented Jan 27, 2025

Describe the bug

We use less as css preprocessor. There we have a setup with mixins filling image-sets.
After this commit:d59efd8 we get vite:resolve warnings.

VITE_ASSET__BgDL8UKD referenced in VITE_ASSET__BgDL8UKD didn't resolve at build time, it will remain unchanged to be resolved at runtime

The build css file looks correct to me though.

The less code looks like this:

.image-from-set(@prop; @path-1x) {
    @{prop}: image-set(@path-1x 1x);
}

.test {
    .image-from-set(background-image, url("./img.png"));
}

The warning is only shown on images that can not be inlined.

Reproduction

https://github.com/GarreltMock/vite-bug-repro

Steps to reproduce

npm install then npm run build

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Max
    Memory: 1.55 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.6.0 - ~/.nvm/versions/node/v22.6.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.3 - ~/.nvm/versions/node/v22.6.0/bin/npm
    pnpm: 9.10.0 - ~/.nvm/versions/node/v22.6.0/bin/pnpm
    bun: 1.0.11 - ~/.bun/bin/bun
  Browsers:
    Chrome: 132.0.6834.111
    Safari: 18.2
  npmPackages:
    vite: ^6.0.5 => 6.0.11

Used Package Manager

npm

Logs

transforming (1) src/main.js
VITE_ASSET__BgDL8UKD referenced in VITE_ASSET__BgDL8UKD didn't resolve at build time, it will remain unchanged to be resolved at runtime
✓ 4 modules transformed.
dist/index.html 0.45 kB │ gzip: 0.29 kB
dist/assets/img-CVimqOIp.png 157.17 kB
dist/assets/index-CzC1NDFV.css 0.12 kB │ gzip: 0.09 kB
dist/assets/index-Dq8oS-Aj.js 0.83 kB │ gzip: 0.46 kB
✓ built in 97ms

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant