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

Issue : babel transformation (syntax error) #78

Open
taruntosh opened this issue Oct 13, 2020 · 5 comments
Open

Issue : babel transformation (syntax error) #78

taruntosh opened this issue Oct 13, 2020 · 5 comments

Comments

@taruntosh
Copy link

Capture
I am sorry, I don't know how to solve this. Please help. Couldn't find help anywhere. Sorry for posting as a issue here.

@CantFayle
Copy link

I am also getting this.

./node_modules/react-awesome-button/src/components/AwesomeButton/index.js
SyntaxError: /home/.../Documents/movie-list/node_modules/react-awesome-button/src/components/AwesomeButton/index.js: Support for the experimental syntax 'jsx' isn't currently enabled (20:25):

  18 | */
  19 | 
> 20 | const Anchor = props => <a {...props} />;
     |                         ^
  21 | const Button = props => <button {...props} />;
  22 | 
  23 | export default class AwesomeButton extends React.Component {

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.

I didn't even have babel installed before getting this error. I haven't been able to render the buttons at all.

Tried installing babel and configuring the modules as in babel/babel#12018 but no luck.

@irfancnk
Copy link

I am having the same issue. Default usage of the button that is shown in the tutorial throws this error. React version is 17.0.1

@Radon333
Copy link

Radon333 commented May 25, 2021

Same issue. Did anyone find a fix?

@sipian
Copy link

sipian commented Jun 8, 2021

I was getting this error when I was including this module using the example given on the website ,

import AwesomeButton from 'react-awesome-button/src/components/AwesomeButton';
import AwesomeButtonProgress from 'react-awesome-button/src/components/AwesomeButtonProgress';
import AwesomeButtonSocial from 'react-awesome-button/src/components/AwesomeButtonSocial';

I fixed this error by following the example in the README. I included this module in my react project as

import { AwesomeButton } from "react-awesome-button";
import "react-awesome-button/dist/styles.css";

@blakfreeman
Copy link

Same problem we should check another solution

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

No branches or pull requests

6 participants