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

Not working with @mui/material #7037

Closed
julianlionti opened this issue Oct 7, 2021 · 5 comments
Closed

Not working with @mui/material #7037

julianlionti opened this issue Oct 7, 2021 · 5 comments

Comments

@julianlionti
Copy link

🐛 bug report

I have created a new project from sctach. Then i install @mui/material and configure parcel like says in the documentation and include any element from that library recieved this error

index.js:8 Uncaught TypeError: Cannot read properties of undefined (reading 'default') at Object.NoSsr (index.js:8) at esmodule-helpers.js:16 at Array.forEach (<anonymous>) at Object.exports.exportAll (esmodule-helpers.js:10) at Object.fc6V0../colors (index.js:11) at newRequire (index.b4af9c3f.js:71) at localRequire (index.b4af9c3f.js:83) at Object.klsNh.react/jsx-runtime (App.tsx:1) at newRequire (index.b4af9c3f.js:71) at localRequire (index.b4af9c3f.js:83)

🎛 Configuration (.babelrc, package.json, cli command)

{
  "scripts": {
    "start": "parcel public/index.html",
    "build": "parcel build public/index.html",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.3.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  },
  "devDependencies": {
    "@types/react": "^17.0.27",
    "@types/react-dom": "^17.0.9",
    "parcel": "^2.0.0-rc.0",
    "typescript": "^4.4.3"
  }
}

😯 Current Behavior

White screen and error in console

💻 Code Sample

import { Typography } from "@mui/material";

export const App = () => {
  return <Typography>Example</Typography>;
};

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-rc.0
Node 14.17.3
npm/Yarn 7.22.0
Operating System Windows 10
@devongovett
Copy link
Member

Did you try the nightly? I think this was recently fixed. #7016

@julianlionti
Copy link
Author

Thanks for the answer! I just tried and same error.

@mischnic
Copy link
Member

mischnic commented Oct 8, 2021

I just tested it with

{
  "dependencies": {
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.3.0",
    "@mui/material": "^5.0.3",
    "parcel": "2.0.0-nightly.867",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  }
}

and it works correctly (both start and build)

@julianlionti
Copy link
Author

julianlionti commented Oct 9, 2021

Hi! Thanks for the answrs. In that version of parcel i get this error.

image

Im also using typescript in my proyect and i hace .parcelrc in it.

{
  "extends": [
    "@parcel/config-default"
  ],
  "transformers": {
    "*.{mp4,svg}": [
      "@parcel/transformer-raw"
    ]
  }
}

@julianlionti
Copy link
Author

I Just tried to create a new proyect with those dependencis and now it works. It seems that i have a problem in other place.

Thanks for your answers

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

3 participants