mui / pigment-css

Pigment CSS is a zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build time.
MIT License
830 stars 39 forks source link

[vite] The CJS build of Vite's Node API is deprecated #67

Open oliviertassinari opened 6 months ago

oliviertassinari commented 6 months ago

Steps to reproduce

  1. Start
  2. See the console

Current behavior

SCR-20240510-biuf

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

Expected behavior

No warning.

Context

The warning goes away if I remove Pigment CSS from the vite config, but then, I'm not using Pigment CSS anymore 🙃

diff --git a/vite.config.js b/vite.config.js
index 78b5110..b39ba6c 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,6 +1,5 @@
 import { defineConfig } from 'vite';
 import react from '@vitejs/plugin-react';
-import { pigment, extendTheme } from '@pigment-css/vite-plugin';

 // To learn more about theming, visit https://github.com/mui/material-ui/blob/master/packages/zero-runtime/README.md#theming
 const theme = extendTheme({

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: -

klingat commented 4 months ago

+1 on this!

iM-GeeKy commented 3 months ago

@brijeshb42 @oliviertassinari Did you find a solution to this?

steveliles commented 1 month ago

"Pigment CSS depends on some of the @mui/* packages internally. We'll be moving away from that which would automatically fix this."

https://github.com/mui/pigment-css/issues/232#issuecomment-2346286306

bfaulk96 commented 2 weeks ago

Is there a timeframe for this getting fixed?

(Edit: I know you're busy, and mean no disrespect by this comment. Just genuinely curious if there's a timeframe/priority set for this, as this issue prevents my company from using Pigment at all at the moment)

brijeshb42 commented 5 days ago

The timeframe is mainly Q1 next year where we are targetting stable v1 release since we are almost working from scratch for it. So it won't be using any of @mui/* packages. To add to it, @mui/* packages are also moving to having proper esm builds. So even with current version, cjs usage will go away when we update to the correct @mui/* version.

bfaulk96 commented 5 days ago

Awesome, thank you for the update!