Skip to content

Experimental syntax breaks CRA applications #20

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

Closed
tractorcow opened this issue Dec 23, 2019 · 6 comments
Closed

Experimental syntax breaks CRA applications #20

tractorcow opened this issue Dec 23, 2019 · 6 comments
Labels
fixed Request complete

Comments

@tractorcow
Copy link

Hello, I've been trying to get metro4-react working with a CRA app, and I've run across an issue where usage of experimental babel syntax is causing issues.

Failed to compile.

./node_modules/metro4-react/src/components/collapse/collapse.jsx 10:24
Module parse failed: Unexpected token (10:24)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| export default class Collapse extends React.Component {
>     static defaultProps = {
|         className: "collapse-css-transition",
|         style: {}

The issue I've had is exactly the same as material-components/material-components-web-react#107, so I won't repeat the conversation. :)

The issue is https://github.com/olton/Metro4-React/blob/master/.babelrc#L6, which cannot be enabled in a CRA without ejecting the app entirely.

Suggested solutions are:

Sorry I'm not really proficient enough to give much more specific suggestions.

@olton olton closed this as completed Dec 23, 2019
@olton
Copy link
Owner

olton commented Dec 23, 2019

Thank you. I will take note.

olton added a commit that referenced this issue Dec 23, 2019
@olton
Copy link
Owner

olton commented Dec 23, 2019

Default props now redefined to:

ComponentName.defaultProps = {...}

@olton olton reopened this Dec 23, 2019
@olton olton added the fixed Request complete label Dec 23, 2019
@tractorcow
Copy link
Author

Thanks @olton :D

@peckyboy
Copy link

Has this been fixed? What's the fix please?

@olton
Copy link
Owner

olton commented Feb 17, 2020

Update to latest

@anton-dementiev
Copy link

Same error as of October 17, 2021 when trying to compile

Failed to compile.

./node_modules/metro4-react/src/components/tag-input/tag-input.js
SyntaxError: /Users/Anton/Desktop/picker/react/node_modules/metro4-react/src/components/tag-input/tag-input.js: Support for the experimental syntax 'jsx' isn't currently enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Request complete
Projects
None yet
Development

No branches or pull requests

4 participants