[vite] Theme injection error in Vite without a theme #48
Labels
enhancement
This is not a bug, nor a new feature
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
When you add a pigment to a new Vite project, following the instructions in the README.md, you get the following error on build:
TypeError: [vite-mui-theme-injection-plugin] Could not load �zero-runtime-styles.css (imported by src/app/main.jsx): Cannot read properties of undefined (reading 'generateStyleSheets')
Turns out the plugin blows up right now unless you add a theme into the config:
I'm not entirely sure if this is a documentation issue or an actual bug, but I feel like it's nice to not require a project to always supply a theme.
Steps:
yarn create vite my-vue-app --template react
yarn build
Repro available in this codespace: https://musical-guacamole-45qr7r77xq2jpg5.github.dev/
Current behavior
Following the README's instructions for a Vite project, you will get a build error instead of a cleanly built project.
Expected behavior
Ideally not including a template doesn't throw an error at build time. Otherwise the README should specify that a theme is required
Context
No response
Your environment
npx @mui/envinfo
Search keywords: theme pigment
The text was updated successfully, but these errors were encountered: