Open yosipy opened 1 month ago
No error occurred in pigment-css v0.0.16.
I solved it by passing the option referring to the following PR: https://github.com/mui/pigment-css/pull/172
--- a/vite_offi/vite.config.ts
+++ b/vite_offi/vite.config.ts
@@ -26,6 +26,9 @@ const theme = extendTheme({
// https://vitejs.dev/config/
export default defineConfig({
+ optimizeDeps: {
+ include: ["prop-types", "react-is"],
+ },
plugins: [
pigment({
theme,
https://ja.vitejs.dev/config/dep-optimization-options#optimizedeps-include
Examples and documentation updates are needed in the mui/material-ui and mui/pigment-css repositories.
We are still working on Pigment CSS's documentation. We'll track this for that.
FWIW this did not work for me: https://github.com/rossipedia/pigment-vite-playground
Just trying to follow the basic Pigment integration docs. My repo doesn't have prop-types
or react-is
as a dependency, so I get this message in console when running vite
when I use @yosipy's solution:
Failed to resolve dependency: prop-types, present in 'optimizeDeps.include'
Failed to resolve dependency: react-is, present in 'optimizeDeps.include'
And then I get the same error described in the original issue
The Pigment CSS - Vite with TypeScript example project with @yosipy's solution seems to run as expected using npm, but it doesn't run using pnpm. I didn't see an issue mentioning it, so I was wondering whether it's a confirmed issue and/or known limitation at this point.
Steps to reproduce
Current behavior
The following error is displayed in the console:
Expected behavior
No response
Context
No response
Your environment
I use Chrome as my browser. Chrome v126.0.6478.127(Official Build)(64bit) I am using wsl2 and Docker compose on Windows 11. ``` # npx @mui/envinfo Need to install the following packages: @mui/envinfo@2.0.19 Ok to proceed? (y) y System: OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm) Binaries: Node: 18.18.0 - /usr/local/bin/node npm: 9.8.1 - /usr/local/bin/npm pnpm: Not Found Browsers: Chrome: Not Found npmPackages: @emotion/react: 11.11.4 @emotion/styled: 11.11.5 @mui/private-theming: 6.0.0-dev.20240529-082515-213b5e33ab @mui/styled-engine: 6.0.0-dev.20240529-082515-213b5e33ab @mui/system: 6.0.0-dev.240424162023-9968b4889d @mui/types: 7.2.15 @mui/utils: 6.0.0-dev.20240529-082515-213b5e33ab @types/react: latest => 18.3.3 react: latest => 18.3.1 react-dom: latest => 18.3.1 typescript: latest => 5.5.3 ```npx @mui/envinfo
Search keywords: Uncaught SyntaxError,0.0.17,vite