I have been using react-calendar-timeline for awhile now with no problems. It has been set as a devDependency like so:
"devDependencies": {
...
"react-calendar-timeline": "git+https://github.com/namespace-ee/react-calendar-timeline.git"
}
Recently I opened up a console on a page that was using it an noticed an error:
Uncaught TypeError: Cannot read property 'pageX' of undefined
After further investigation, I noticed it was coming from this function in react-calendar-timeline:
// Get specified X/Y coords for mouse or event.touches[0]
function getXY (type, pointer, xy) {
xy = xy || {};
type = type || 'page';
xy.x = pointer[type + 'X']; // <---- error on this line
xy.y = pointer[type + 'Y'];
return xy;
}
Why is this happening now? Is there anything that I can do do make it go away?
You probably need to upgrade your installed version of interact.js
https://github.com/taye/interact.js/issues/251
Thanks @mariusandra ! That was it.
I have been using react-calendar-timeline for my react webstite
I have installed the necessary libraries
npm install --save react-calendar-timeline
npm install --save react react-dom
npm install --save moment interact.js
Then import to website
import Timeline from 'react-calendar-timeline';
I compile the code with gulp but there was an error on this line
events.js:160
throw er; // Unhandled 'error' event
^
SyntaxError: Unexpected token
Why is this happening now? How to fix? Hope to get help from you.
Most helpful comment
You probably need to upgrade your installed version of interact.js
https://github.com/taye/interact.js/issues/251