elierotenberg / elierotenberg/react-animate

Module parse failed with webpack/babel compilation

Open
#14 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
269
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm trying to add this package to a pre-existing project where I'm using webpack to compile with babel. However this package is breaking on compilation with the following error:

```
ERROR in ./~/react-animate/src/index.jsx
Module parse failed: /path/to/project/node_modules/react-animate/src/index.jsx Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import raf from 'raf';
| import tween from 'tween-interpolate';
| import _ from 'lodash';
```

I know that using `babel` is a requirement for this package, but I am using `babel` (webpack uses `babel-loader`). Here is the relevant part of my `webpack.config.js`:

```
entry: [
"babel-polyfill",
"./js/index.js"
],
output: {
filename: "../project/path/bundle.js"
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [
{
loader: 'babel-loader',
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
query: {
plugins: ['transform-runtime'],
presets: ['es2015', 'stage-0', 'react'],
}
}
]
}
```

I'm not sure exactly what the problem could be as I have already successfully been using other packages and writing my own ES6/ES7 code with no issues. Any idea if this is a faulty configuration on my end or something that needs to be fixed in the package itself?

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.