Alpha release breaks snowpack build
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Material UI 5.0.0-alpha.35 breaks SnowPack and throws error:
SyntaxError: indirect export not found: SliderMark
See discussion in https://github.com/snowpackjs/snowpack/issues/3004 for details. Particularly comments: https://github.com/snowpackjs/snowpack/issues/3004#issuecomment-819625853, https://github.com/snowpackjs/snowpack/issues/3004#issuecomment-826376507, https://github.com/snowpackjs/snowpack/issues/3004#issuecomment-846852342
latest stable version of material-ui (4.11.4) seems to be working fine. So i was thinking maybe it would be easy to isolate what the problem is if I opened a bug report here.
Expected Behavior 🤔
MaterialUI should be able to work with SnowPack without issues.
Steps to Reproduce 🕹
Steps:
npx create-snowpack-app material-ui-test --template @snowpack/app-template-react-typescript
cd material-ui-test
npm install @material-ui/core@next @emotion/react @emotion/styled
echo "import { AppBar } from '@material-ui/core';" > src/App2.tsx
cat src/App.tsx >> src/App2.tsx
sed -ie 's/Learn React/<AppBar\/>/' src/App2.tsx
mv src/App2.tsx src/App.tsx
npm run start
Context 🔦
I am trying to test out the new styled solution provided in mui 5 using emotion so was taking a look at the latest alpha release and ran into this issue.
Your Environment 🌎
`npx @material-ui/envinfo`
npx: installed 2 in 3.123s
System:
OS: Linux 5.11 void
Binaries:
Node: 14.16.0 - /usr/bin/node
Yarn: 1.22.10 - /usr/bin/yarn
npm: 6.14.11 - /usr/bin/npm
Browsers:
Chrome: Not Found
Firefox: 88.0
npmPackages:
@emotion/react: ^11.4.0 => 11.4.0
@emotion/styled: ^11.3.0 => 11.3.0
@material-ui/core: ^5.0.0-alpha.35 => 5.0.0-alpha.35
@material-ui/private-theming: 5.0.0-alpha.35
@material-ui/styled-engine: 5.0.0-alpha.34
@material-ui/system: 5.0.0-alpha.35
@material-ui/types: 6.0.1
@material-ui/unstyled: 5.0.0-alpha.35
@material-ui/utils: 5.0.0-alpha.35
@types/react: ^17.0.4 => 17.0.9
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.2.4 => 4.3.2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7 (4 by maintainers)
Top GitHub Comments
I can respect not wanting to ship a change that adds maintenance, and potential bugs. But if it makes it any easier, wildcard exports (
"./*": "./esm/*"
) could potentially ease the maintenance burden.That’s not really Snowpack’s stance, at least. The reality is that there is no official “old behavior” for ESM to even implement, as
"module"
was never standardized and it doesn’t work with the way the documentation is currently written. Essentially, this is how users should be loading the ESM modules if they’d like to:Really this comes down to either educating users how to import ESM vs CJS (docs), or doing it automatically for them (package exports). Either will work! But something has to change if a user is following the docs but wants ESM.
@eps1lon This is a response from @drwpow in the snowpack thread https://github.com/snowpackjs/snowpack/issues/3004#issuecomment-876679105
Is this something actionable? Adding the exports/guidelines as suggested?