Skip to content

Vite V6 + PigmentCSS results in "Failed to load CSS for [..]/root.pigment.css" #13379

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

Open
MonaMayrhofer opened this issue Apr 7, 2025 · 0 comments

Comments

@MonaMayrhofer
Copy link

I'm using React Router as a...

framework

Reproduction

Visit https://stackblitz.com/edit/github-pq121seq. Once reload the page in the stackblitz preview and you will see the error messages in the terminal.

System Info

SystemInfo of the Stackblitz Reproduction

  System:
    OS: Linux 5.0 undefined
    CPU: (2) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @pigment-css/react: ^0.0.30 => 0.0.30 
    @pigment-css/vite-plugin: ^0.0.30 => 0.0.30 
    @react-router/dev: * => 7.5.0 
    @react-router/node: * => 7.5.0 
    @react-router/serve: * => 7.5.0 
    react-router: * => 7.5.0 
    vite: ^6.0.11 => 6.2.5

Used Package Manager

npm

Expected Behavior

PigmentCSS styles should be successfully applied and no error should be logged in the console. - The same behavior as one gets using vite v5

Actual Behavior

When using vite >= v6.0.0 and pigment-css, everytime a page containing pigment-css classes is refreshed an error is logged in the console.

Failed to load CSS for /tmp/my-react-router-app/app/root.pigment.css
The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose

The styles sometimes get applied, and sometimes not. (I could not figure out exactly when the styles get fully dropped)
The error gets logged regardless of whether the styles are applied successfully.

The error is not displayed when using vite v5.4.17.

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

2 participants