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

Fix babel readonly #167

Merged
merged 4 commits into from Oct 15, 2018

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Oct 15, 2018

Without the fix the new test case for *-wrap-es5 would transpile to

var variants = (babelHelpers.readOnlyError("variants"), process.env.NODE_ENV !== "production" ? [null] : {});;

Which throws at runtime. Overall problem is that the template returns an AssignmentExpression which is used in this code as a VariableDeclarator which confuses babel.

A clean fix would be to check if the scope of declarations is already wrapped but that is not trivial (as is wrapping/removing unused references anyway) and I wanted this fix to be as simple as possible to fix mui/material-ui#13245

src/index.js Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

Failed prop type: "deprecatedVariants" is read-only in Typography
3 participants