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

🐛 BUG: Inability to use MUI with a React app #4079

Closed
1 task
andrewdavidcostello opened this issue Jul 28, 2022 · 4 comments · Fixed by #5016
Closed
1 task

🐛 BUG: Inability to use MUI with a React app #4079

andrewdavidcostello opened this issue Jul 28, 2022 · 4 comments · Fixed by #5016
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work

Comments

@andrewdavidcostello
Copy link

What version of astro are you using?

1.0.0-rc.2

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

This is a new fresh create astro with react and material-ui added to test library compatibility.

Running dev is fine but running build results in the below error before adding material ui to noExternal:

Screenshot 2022-07-28 at 14 02 47

After adding mui to noExternal:

Screenshot 2022-07-28 at 14 06 34

This may simply be an issue with material ui, apologies if so.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-mggo3n?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@matthewp
Copy link
Contributor

You probably want to add @mui/material to vite.ssr.noExternals.

@andrewdavidcostello
Copy link
Author

You probably want to add @mui/material to vite.ssr.noExternals.

Thanks for the reply but as per above that is exactly what I tried, the before and after error. Final example on stackblitz shows it in noExtenal.

@codingfunwoody
Copy link

swithc to client-only for workaround
https://github.com/withastro/astro/issues/4107#issuecomment-1215069951

@matthewp
Copy link
Contributor

matthewp commented Oct 6, 2022

Going to add a warning for this one.

@matthewp matthewp self-assigned this Oct 6, 2022
@matthewp matthewp added - P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work labels Oct 6, 2022
@matthewp matthewp changed the title 🐛 BUG: Package subpath './helpers/esm/objectWithoutPropertiesLoose.js' is not defined by "exports" 🐛 BUG: Inability to use MUI with a React app Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: external External library doesn't work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants