🐛 BUG: not work with @mui/material ( @material-ui v5 )
See original GitHub issueQuick checklist
- I am using the latest version of Snowpack and all plugins.
What package manager are you using?
yarn
What operating system are you using?
macOS, Linux
Describe the bug
a strange error when snowpack dev whith @mui/material (or @material-ui/core v5)
my app.tsx like:
import { h } from 'preact';
import './App.css';
// import { useState, useEffect } from 'preact/hooks';
// import logo from './logo.svg';
// import { makeStyles } from '@mui/styles';
// import { ThemeProvider } from '@mui/material/styles';
import { Button } from '@mui/material';
function App() {
return (
<Button>Hello !</Button>
)
}
i got error message
The requested module '/_snowpack/pkg/@mui.core.ModalUnstyled.v5.0.0-alpha.47.js' does not provide an export named 'SliderMark'
check this file
node_modules/.cache/snowpack/build/@mui/material@5.0.0/@mui/material.js
MUI components export from '@mui/core/ModalUnstyled'
😱
export { SliderMark, SliderMarkLabel, SliderRail, ................ } from '@mui/core/ModalUnstyled';
is that a esbuild bug ?
i can fix it with
import Button from '@mui/material/Button';
Steps to reproduce
npx create-snowpack-app
using template app-template-preact-typescriptyarn add @mui/material @emotion/react @emotion/styled
- add @mui component to App.tsx
import { Typography } from "@mui/material"
yarn start
- error:
The requested module '/_snowpack/pkg/@mui.core.ModalUnstyled.v5.0.0-alpha.47.js' does not provide an export named 'SliderMark'
Link to minimal reproducible example (optional)
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Troubleshooting - Material UI - MUI
Troubleshooting. This document covers known issues and common problems encountered when migrating from Material UI v4 to v5.
Read more >mui/styles v5 is not compatible with React 18 #32142 - GitHub
As noted in https://mui.com/styles/basics/, @mui/styles is the Material UI v4 legacy styling solution. We don't guarantee the compatibility with React 18.
Read more >Material-UI v5 not working styled-components and typescript?
when doing: import { ThemeProvider } from "@mui/material/styles";. I made a Code Sandbox to show my setup. Does anyone know what I'm doing...
Read more >Visual issues of React Material UI after migrating from v4 to v5
Fixing a visual issue with makeStyles that only appears on Production after you migrate from React Material UI v4 to v5.
Read more >module not found: error: can't resolve '@mui/material/styles'
To fix this error, you must install the package '@mui/material ' before using it. Open the terminal and run the following command to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is caused by “circular references” i can fix it now ↓ edit
node_modules/@mui/material/Modal/Modal.js
and
node_modules/@mui/material/Modal/index.js
and clean cache
I also still have this problem? Why it’s not working??
Uncaught SyntaxError: The requested module '/_snowpack/pkg/@mui.core.ModalUnstyled.v5.0.0-alpha.48.js' does not provide an export named 'SliderMark'