Vite build fail on css-post since 2.9.2
See original GitHub issueDescribe the bug
Since 2.9.2, I can’t build my project. There seems to be some kind of CSS transform error.
I want to add that reverting to 2.9.1 fix the issue, so that might be introduced recently.
[vite:css-post] Transform failed with 2 errors
[...]
ELIFECYCLE Command failed with exit code 1.
The ;
inside the string in this line seems to be the cause:
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600;800&family=Rubik:wght@400&family=Source+Code+Pro:wght@400;600&display=swap');
⚠️ Note: I had to modify the esbuild\lib\main.js
file to trace it back here, it could be nice to have a better error display.
Btw, I still don’t really know if it’s cause by Vite or Esbuild…
Reproduction
https://stackblitz.com/edit/vitejs-vite-k8dfzr?file=src%2FApp.vue&terminal=dev
I added the faulty line in the CSS of App.vue.
System Info
System:
OS: Windows 10 10.0.22000
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 9.58 GB / 31.84 GB
Binaries:
Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (100.0.1185.36)
Internet Explorer: 11.0.22000.120
npmPackages:
@vitejs/plugin-vue: ^2.3.1 => 2.3.1
vite: ^2.9.2 => 2.9.2
Used Package Manager
pnpm
Logs
[...]
[vite:css-post] Transform failed with 2 errors:
<stdin>:1:4371: ERROR: Unterminated string token
<stdin>:73:86: ERROR: Unterminated string token
error during build:
Error: Transform failed with 2 errors:
<stdin>:1:4371: ERROR: Unterminated string token
<stdin>:73:86: ERROR: Unterminated string token
at failureErrorWithLog (D:\Library\Projects\LunaPark\node_modules\.pnpm\esbuild@0.14.34\node_modules\esbuild\lib\main.js:1603:15)
at D:\Library\Projects\LunaPark\node_modules\.pnpm\esbuild@0.14.34\node_modules\esbuild\lib\main.js:1392:29
at D:\Library\Projects\LunaPark\node_modules\.pnpm\esbuild@0.14.34\node_modules\esbuild\lib\main.js:666:9
at handleIncomingPacket (D:\Library\Projects\LunaPark\node_modules\.pnpm\esbuild@0.14.34\node_modules\esbuild\lib\main.js:763:9)
at Socket.readFromStdout (D:\Library\Projects\LunaPark\node_modules\.pnpm\esbuild@0.14.34\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
ELIFECYCLE Command failed with exit code 1.
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.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
Build #. Built file does not work because of CORS error #. If the HTML file output was opened with file protocol, the...
Read more >yarn create vite error | The AI Search Engine You Control
I'm trying to create a frontend project in Vite, using the yarn create vite command, but I'm getting the following error: error with...
Read more >Build fails with latest version of vite, vercel-adapter and sveltekit
I have updated my npm dependencies to their latest versions and now I am not able to create a build. The error I...
Read more >vite - npm
Native-ESM powered web dev build tool. Latest version: 4.0.3, last published: 4 days ago. Start using vite in your project by running `npm...
Read more >vite build - patak-dev
Each JS and CSS chunk needs to be minified for production. Vite also uses esbuild for this task for both languages since Vite...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in vite@2.9.4, thanks for the PR again @hugoattal
I feel this one https://github.com/vitejs/vite/pull/7691 is affecting. (have not checked)