Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Unexpected Token from dependency CSS import #603

@mastastealth

Description

@mastastealth

Describe the regression

I have a dependency in an app that imports some fonts using require (so not sure if that's related to this?), but this is working fine under Vite 7 right now. In trying the Rolldown version though, it fails with:
Image

Reproduction

https://stackblitz.com/edit/vitejs-vite-axp1eycg?file=src%2FApp.tsx

Expected Behavior

I would expect this to build just as it has before, with a deprecation warning or something in the event I need to be moving away from a certain style of code.

Actual Behavior

You can see the crash in the browser console of the Stackblitz repro. I mimic'd the dependency as concisely as I could to the real one we use (a design system library in the company).

Steps to Reproduce

You can flip between Vite ^7.0.0 to see it work and it crash with the simple change to the rolldown version, there are no special configurations that are altered in the Vite config either.

System Info

In the linked repro

Used Package Manager

pnpm

Logs

Click to expand!
Error: [31mError during dependency optimization:

[39mBuild failed with 2 errors:

[31m[PARSE_ERROR] Error:[0m Unexpected token
   [38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m node_modules/.pnpm/@fontsource+material-icons@5.2.7/node_modules/@fontsource/material-icons/index.css:2:6 [38;5;246m][0m
   [38;5;246m│[0m
 [38;5;246m2 │[0m [38;5;249m@[0m[38;5;249mf[0m[38;5;249mo[0m[38;5;249mn[0m[38;5;249mt[0m-[38;5;249mf[0m[38;5;249ma[0m[38;5;249mc[0m[38;5;249me[0m[38;5;249m [0m[38;5;249m{[0m
 [38;5;240m  │[0m      ┬  
 [38;5;240m  │[0m      ╰── 
[38;5;246m───╯[0m

[31m[PARSE_ERROR] Error:[0m Unexpected token
   [38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m node_modules/.pnpm/@fontsource+roboto-mono@5.2.8/node_modules/@fontsource/roboto-mono/index.css:2:6 [38;5;246m][0m
   [38;5;246m│[0m
 [38;5;246m2 │[0m [38;5;249m@[0m[38;5;249mf[0m[38;5;249mo[0m[38;5;249mn[0m[38;5;249mt[0m-[38;5;249mf[0m[38;5;249ma[0m[38;5;249mc[0m[38;5;249me[0m[38;5;249m [0m[38;5;249m{[0m
 [38;5;240m  │[0m      ┬  
 [38;5;240m  │[0m      ╰── 
[38;5;246m───╯[0m

(copied from Stackblitz, which is not as clear as error image above but it's whining about @font-face in some CSS)

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions