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: problem with default export / import in some cases #3927

Open
1 task done
oclyke opened this issue Nov 3, 2022 · 1 comment
Open
1 task done

🐛 BUG: problem with default export / import in some cases #3927

oclyke opened this issue Nov 3, 2022 · 1 comment

Comments

@oclyke
Copy link

oclyke commented Nov 3, 2022

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

Describe the bug

Possibly related to: #3926

Using all the latest:

  • react (18)
  • @mui (v5)
  • snowpack (3.8.x)

I am unable to actually use any MUI features due to a runtime error where an object is called like a function.

This appears to happen because one of MUIs dependencies (@emotion) is trying to default export the function createCache but somewhere in the process this is messed up and we get createCache = {default: f} rather than the expected createCache = f

I think the @mui and @emotion code looks good, so I am suspecting snowpack or some weird shenanigans here as the culprit. Hoping someone will be more familiar and able to at least give 👍 / 👎 on this theory.

Steps to reproduce

Clone my minimal example (below) then yarn install && yarn start
You should see the same error...
Screen Shot 2022-11-02 at 8 34 43 PM

Link to minimal reproducible example (optional)

https://github.com/oclyke-zucchini/snowpack-mui-emotion-createCache-not-function

@grumd
Copy link

grumd commented Nov 8, 2022

Snowpack isn't maintained anymore. No commits in 10 months.
Check out Vite for an alternative.

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

No branches or pull requests

2 participants