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

Syntax error while building #1

Open
Honoo opened this issue Apr 20, 2017 · 1 comment
Open

Syntax error while building #1

Honoo opened this issue Apr 20, 2017 · 1 comment

Comments

@Honoo
Copy link

Honoo commented Apr 20, 2017

When trying to build with webpack, it says there is a syntax error in the given src/index.js:


ERROR in ./src/index.js
Module build failed: SyntaxError: Unexpected token (5:16)

3 | import App from './views/App';
4 | 
>5 | ReactDOM.render(<App/>, document.getElementById('app'));
                     ^
 @ multi ./src/index
@Honoo
Copy link
Author

Honoo commented Apr 20, 2017

To solve this, it appears that additional libraries are required.

In package.json, under devDependencies:

"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",

In webpack.config.js, in the loaders object:

query:
{
  presets:['react', 'es2015']
}

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

1 participant