question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 BUG: not work with @mui/material ( @material-ui v5 )

See original GitHub issue

Quick 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

  1. npx create-snowpack-app using template app-template-preact-typescript
  2. yarn add @mui/material @emotion/react @emotion/styled
  3. add @mui component to App.tsx import { Typography } from "@mui/material"
  4. yarn start
  5. 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:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
TongChiacommented, Sep 26, 2021

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'

I think this is caused by “circular references” i can fix it now ↓ edit node_modules/@mui/material/Modal/Modal.js

// import ModalUnstyled, { modalUnstyledClasses } from '@mui/core/ModalUnstyled';
import { ModalUnstyled, modalUnstyledClasses } from '@mui/core';

and node_modules/@mui/material/Modal/index.js

// export * from '@mui/core/ModalUnstyled';
export { ModalUnstyled, ModalManager, modalUnstyledClasses, getModalUtilityClass } from '@mui/core';

and clean cache

rm -rf node_modules/.cache
1reaction
GoldenTKcommented, Sep 25, 2021

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'

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found