mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
92.45k stars 31.85k forks source link

examples/cdn broken at 'var CSS = global.CSS' #13531

Closed nealeu closed 5 years ago

nealeu commented 5 years ago

The CDN build as demonstrated loading examples/cdn at version 3.4.0 (gitish c9a192ef91e47a2b2efb5d2a00b253d60e380400)

Expected Behavior

Page displays

Current Behavior

Page doesn't display. Debugger console shows

Uncaught ReferenceError: global is not defined
    at material-ui.development.js:2267
    at createCommonjsModule (material-ui.development.js:466)
    at material-ui.development.js:2262

Steps to Reproduce

adamjhamer commented 5 years ago

The error message is the same as per https://github.com/mui-org/material-ui/issues/11876 (except for line numbers).

oliviertassinari commented 5 years ago

It's most likely a regression introduced by #13426.

oliviertassinari commented 5 years ago

It was fixed in https://github.com/cssinjs/jss/pull/893/files#diff-be5d1e673539678d56509d095ce7c3d3L1 but I doubt we will be abel to leverage this patch anytime soon. We gonna need to revert part of #13426 cc @TrySound.

@nealeu @adamjhamer how important is this for you? It would help use provide the appropriate response. For instance, we could add a regression test or release a quick patch.

nealeu commented 5 years ago

Hi @oliviertassinari

We're currently on a CDN build of 0.20 (not sure if it's actually with some patches of mine to remove onTouchTap either), but were wanting to use some newer components., so were spiking the change.

We can wait and get by with what we have (esp as we've blown a lot of our hackathon on CRA+Typescript+monorepo with pnpm :-| ). Updating MUI is the least of our problems.

Cheers, Neale

TrySound commented 5 years ago

@oliviertassinari Sorry, I forgot jss didn't land global ponyfill yet. I think we may bring node-globals back without reverting to fix this.

oliviertassinari commented 5 years ago

node-globals

Yes, I think that we can bring it back.

nealeu commented 5 years ago

Thanks @oliviertassinari. I'll give our upgrade another spin :)

nealeu commented 5 years ago

@oliviertassinari,

Just to say that this is validated as of adcf8ac6787b90787b4bb23f0f10cff8de1c8047, as I'm using a locally built UMD release based on that rev now.

oliviertassinari commented 5 years ago

@nealeu The fix was released. It's live.

nealeu commented 5 years ago

Thanks @oliviertassinari. Yes. I noticed last night that I'd overlapped the release. Thanks for getting it sorted quickly.