namespace-ee / react-calendar-timeline

A modern and responsive react timeline component.
MIT License
1.94k stars 637 forks source link

Static propTypes error #371

Closed tymochko closed 6 years ago

tymochko commented 6 years ago

Hi, I installed "react-calendar-timeline" but constantly getting an error about:

ERROR in .../node_modules/react-calendar-timeline/src/lib/Timeline.js 36:19
Module parse failed: Unexpected token (36:19)
You may need an appropriate loader to handle this file type.
|
| export default class ReactCalendarTimeline extends Component {
>   static propTypes = {
|     groups: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,
|     items: PropTypes.oneOfType([PropTypes.array, PropTypes.object]).isRequired,

Although my .babelrc looks like this (I assume I did everything right, stage-2 includes "transform-class-properties", even thou I tried stage-1 and stage-0)

{
  "presets": [
    "env",
    "react",
    "stage-2",
    "flow"
  ],
  "plugins": [
    "add-module-exports",
    "transform-runtime"
  ],
  "comments": false
}

somehow "react-calendar-timeline" get into webpack running process with the uncompiled code. Part of webpack.config.js which shows that node_modules are not going to be bundled.

{
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'babel-loader'
    }

Please help to solve this problem.

Ilaiwi commented 6 years ago

try react-calendar-timeline/lib please read this

tymochko commented 6 years ago

Yes, it helps. But only after installing interactjs. For some reason it didn't installed itself with a library.

Thank you.

Ilaiwi commented 6 years ago

yes it is a peer dependency