casesandberg / casesandberg/react-pace

Module parse failed / SyntaxError: Unexpected token

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hi!

I'm having this error when trying to run my dev-build:

```
ERROR in ./~/react-pace/src/Pace.jsx
Module parse failed: C:\Projetos\Atlas\dev\v2\Atlas\Atlas.Web\node_modules\react-pace\src\Pace.jsx Unexpected token (21:6)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (21:6
```

At first I thought it was missing a loader for JSX in my webpack loaders config , but after adding *.jsx into the regex and the `babel-preset-react` into the presets it still don't work.

My webpack.config:

```
module: {
loaders: [
//{
// test: /\.(js)$/,
// exclude: /node_modules/,
// loader: 'babel',
// query: {
// presets: ['es2015', 'react']
// }
//},
{
test: /\.jsx?$/, // Match both .js and .jsx files
exclude: /node_modules/,
loader: "babel",
query:
{
presets: ['es2015', 'react']
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')

},
{
test: /\.(png|jpg|gif)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=100000'
},
{
test: /\.(eot|com|json|ttf|woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
}
]
}

```

my package.json:

```
{
"scripts": {
"dev-build": "webpack -d --config webpack.config.js --colors",
"dev-watch": "webpack -d --config webpack.config.js --watch --colors",
"prod-build": "SET NODE_ENV=production&&webpack -p --config webpack.config.js --colors"
},
"dependencies": {
"flux": "2.1.1",
"history": "2.1.1",
"marked": "0.3.5",
"react": "15.0.2",
"react-dom": "15.0.2",
"react-router": "2.4.0",
"react-addons-css-transition-group": "15.0.2",
"react-addons-update": "15.0.2",
"react-dnd": "2.1.4",
"react-dnd-html5-backend": "2.1.2",
"whatwg-fetch": "1.0.0",
"babel-polyfill": "6.8.0",

"animate.css": "^3.1.1",
"bootstrap": "^3.3.7",
"dom-tools": "^0.1.4",
"font-awesome": "^4.6.1",
"jquery": "^2.2.3",
"jquery-slimscroll": "^1.3.6",
"metismenu": "^2.5.0",
"react-bootstrap": "^0.28.3",
"react-pace": "^1.0.0"
},
"devDependencies": {
"babel-core": "6.8.0",
"babel-loader": "6.2.4",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"webpack": "1.13.0",
"webpack-dev-server": "1.13.0",
"html-webpack-plugin": "2.16.0",

"css-loader": "^0.23.1",
"babel-eslint": "^4.1.3",
"babel-preset-stage-0": "^6.0.15",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"path": "^0.12.7",
"react-hot-loader": "^1.3.0",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7"
}
}
```

Any thoughts on that? Any help is appreciated! Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.