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

Unable to use MUI icons with Remix #9410

Closed
antoinech2 opened this issue May 10, 2024 · 1 comment
Closed

Unable to use MUI icons with Remix #9410

antoinech2 opened this issue May 10, 2024 · 1 comment

Comments

@antoinech2
Copy link

antoinech2 commented May 10, 2024

Reproduction

  • Create blank project with npx create-remix@latest
  • Install MUI dependencies : npm install @mui/material @emotion/react @emotion/styled, npm install @mui/icons-material
  • Import an icon in _index.tsx : import AccessibilityIcon from '@mui/icons-material/Accessibility';
  • Render the icon in JSX
  • Run npm run dev

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 1.94 GB / 15.39 GB
  Binaries:
    Node: 20.12.2 - ~\Documents\node-v20.12.2-win-x64\node.EXE
    npm: 10.7.0 - ~\Documents\node-v20.12.2-win-x64\npm.CMD
  Browsers:
    Edge: Chromium (124.0.2478.80)
    Internet Explorer: 11.0.22621.1

Used Package Manager

npm

Expected Behavior

Component should render correctly

Actual Behavior

Import is not working.
Error :

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    at renderElement (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6120:9)
    at renderNodeDestructiveImpl (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
    at renderNodeDestructive (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderChildrenArray (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6288:7)
    at renderNodeDestructiveImpl (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6218:7)
    at renderNodeDestructive (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
    at renderNode (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6336:12)
    at renderHostElement (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:5708:3)
    at renderElement (/home/projects/remix-run-remix-yxktta/node_modules/react-dom/cjs/react-dom-server.node.development.js:6029:5)

I have tried absolutely everything for hours and look up for dozens of forums but I can't find a solution...

@antoinech2
Copy link
Author

PS : I have found possible working solutions with Vite, but I'm using Classic Remix Compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants