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

JS Error: Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode #1121

Closed
Webkadabra opened this issue Jul 11, 2015 · 7 comments
Labels
package: system Specific to @mui/system

Comments

@Webkadabra
Copy link

Just updated to latest material-ui, and after I compile my app with WebPack, there is a JS error on a page:

Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Seems like problem is in file:

./~/material-ui/src/mixins/classable.js ***!

This line:

/** @jsx React.DOM /let React = webpack_require(/! react */ 2);

Please, advice, as I have a guess this is not what everyone else is experiencing?

@jkruder
Copy link
Contributor

jkruder commented Jul 11, 2015

It looks like you're trying to rebuild material-ui with webpack. You'll need to transpile the src files using a tool like babel. Can you describe your process? Do you perform any actions before you compile with WebPack?

@Webkadabra
Copy link
Author

I have a working webpack config that uses JSX-loader, and it was fine until I updated Material UI from 0.9.0 to latest. I suppose this really may be a problem of my setup.
I gave a quick try to babel, but it had some weird errors like "not able to find babel/extend", so I decided to try fix my issue first, before I go deep into changing from jsx-loader to Babel. Do you suggest switching to babel alltogether?

@jkruder
Copy link
Contributor

jkruder commented Jul 11, 2015

Yes, babel is fantastic. It's well maintained and they even managed to get facebook to switch from maintaining their own tool! It also has some support for experimental ES7 features.

@Webkadabra
Copy link
Author

@jkruder thanks, I switched to babel. It was a bit tricky, since not all examples tell you have to enable stage=0 for all to be working.
Anyways, these clickawayable and classable mixins still don't render (thrown complication error), but I don't really need them.
Thanks again!

@jkruder
Copy link
Contributor

jkruder commented Jul 12, 2015

Glad you were able to get it mostly working. You might find that some components don't work right without the clickawayable mixin. If you want I can try to provide some help with the errors you're seeing.

@Marktz
Copy link

Marktz commented Oct 9, 2015

Hello , Guys Am Using Babel And Still Got Same Errno Here What Should I dO should I try jsx loader ?

@Marktz
Copy link

Marktz commented Oct 9, 2015

SyntaxError: c:\Users\Mark Francis\package.json: Unexpected string
at Object.parse (native)
at Object.Module._extensions..json (module.js:460:27)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at module.exports (c:\Users\Mark Francis\node_modules\gulp-load-plugins\inde
x.js:43:49)
at Object. (c:\Users\Mark Francis\gulpfile.js:8:37)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
* Add visual regression tests

* Make docs run in backgorund on ci for tests

* Fix percy command not found error

* Add cypress verify on install

* Restory cypress binary cache before running

* Add additional yarn install

* Change order of builds

* Fix tsconfig.json error

* Add more visual regression scenarios

* Update config.yml

* Disable random icons in percy

* Make year to be 2019 in tests

* Add more scenarios

* Completely hide Ads in percy
@zannager zannager added the package: system Specific to @mui/system label Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system
Projects
None yet
Development

No branches or pull requests

4 participants