Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@mui/material/styles/styled 4 level import fixed #32

Merged
merged 2 commits into from
Apr 20, 2023
Merged

@mui/material/styles/styled 4 level import fixed #32

merged 2 commits into from
Apr 20, 2023

Conversation

abelozerov
Copy link
Contributor

Unsupported MUI 4 level import fixed.
"@mui/material": "5.11.4"

See mui/material-ui#35773 (comment)

Caused:

SyntaxError: Cannot use import statement outside a module
 ❯ Object.<anonymous> node_modules/mui-nested-menu/index.js:7:38

Module /node_modules/@mui/material/styles/styled.js:1 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@mui/material" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.

As a temporary workaround you can try to inline the package by updating your config:

// vitest.config.js
export default {
  test: {
    deps: {
      inline: [
        "@mui/material"
      ]
    }
  }
}

@vercel
Copy link

vercel bot commented Jan 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mui-nested-menu ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2023 5:03am

@webzep
Copy link
Owner

webzep commented Apr 20, 2023

Published under 2.2.1. Thanks for contributing.

@abelozerov abelozerov deleted the fix_mui_4_level_imports branch April 20, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants