-
-
Notifications
You must be signed in to change notification settings - Fork 8k
image-set with image in base64 format cause error #8028
Copy link
Copy link
Closed
Labels
feat: cssregressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
When using image-set, it can use image in base64, like this:
cursor: --webkit-image-set(
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=)
1x,
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC)
2x
)
5 8,
text;But after running npm run build, you may get an error. This only happens in the latest version 2.9.8。
I think this pr #7874 broke this behavior.
Reproduction
https://stackblitz.com/edit/vitejs-vite-uzayyp?file=src/App.css
System Info
System:
OS: macOS 11.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.22 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v14.17.0/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Browsers:
Chrome: 101.0.4951.54
Edge: 100.0.1185.39
Firefox: 99.0.1
Safari: 14.0.3Used Package Manager
npm
Logs
[vite:css-post] Transform failed with 2 errors:
<stdin>:42:31: ERROR: Expected ")" to end URL token
<stdin>:42:215: ERROR: Expected ")" to end URL token
✘ [ERROR] Expected ")" to end URL token
<stdin>:42:31:
42 │ background: image-set(url(url(data:image/png;base64) , url(iVBOR...
╵ ^
✘ [ERROR] Expected ")" to end URL token
<stdin>:42:215:
42 │ ...AAAAASUVORK5CYII=)) 1x, url(url(data:image/png;base64) , url(iV...
╵ ^
error during build:
Error: Transform failed with 2 errors:
<stdin>:42:31: ERROR: Expected ")" to end URL token
<stdin>:42:215: ERROR: Expected ")" to end URL token
at failureErrorWithLog (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:1557:15)
at eval (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:1346:29)
at eval (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:637:9)
at handleIncomingPacket (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:734:9)
at Socket.readFromStdout (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:604:7)
at Socket.EventEmitter.emit (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:155505)
at addChunk (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656340)
at readableAddChunk (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656044)
at Socket.Readable.push (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656728)
at _0x9a1e99.onStreamRead [as onread] (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:783839)
~/projects/vitejs-vite-uzayyp
❯ npm run build
$ vite build
vite v2.9.8 building for production...
✓ 34 modules transformed.
[vite:css-post] Transform failed with 2 errors:
<stdin>:42:31: ERROR: Expected ")" to end URL token
<stdin>:42:215: ERROR: Expected ")" to end URL token
✘ [ERROR] Expected ")" to end URL token
<stdin>:42:31:
42 │ background: image-set(url(url(data:image/png;base64) , url(iVBOR...
╵ ^
✘ [ERROR] Expected ")" to end URL token
<stdin>:42:215:
42 │ ...AAAAASUVORK5CYII=)) 1x, url(url(data:image/png;base64) , url(iV...
╵ ^
error during build:
Error: Transform failed with 2 errors:
<stdin>:42:31: ERROR: Expected ")" to end URL token
<stdin>:42:215: ERROR: Expected ")" to end URL token
at failureErrorWithLog (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:1557:15)
at eval (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:1346:29)
at eval (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:637:9)
at handleIncomingPacket (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:734:9)
at Socket.readFromStdout (/home/projects/vitejs-vite-uzayyp/node_modules/esbuild/lib/main.js:604:7)
at Socket.EventEmitter.emit (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:155505)
at addChunk (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656340)
at readableAddChunk (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656044)
at Socket.Readable.push (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656728)
at _0x9a1e99.onStreamRead [as onread] (https://vitejs-vite-uzayyp.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:783839)Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: cssregressionThe issue only appears after a new releaseThe issue only appears after a new release