question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vite build fail on css-post since 2.9.2

See original GitHub issue

Describe 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
patak-devcommented, Apr 13, 2022

Fixed in vite@2.9.4, thanks for the PR again @hugoattal

2reactions
sapphi-redcommented, Apr 13, 2022

I feel this one https://github.com/vitejs/vite/pull/7691 is affecting. (have not checked)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found