react-idle-timer: After installing Latest version of React-idle-timeout getting compilation error
I’m not using React CRA in my project . Current version npm i react-idle-timer@5.0.0-rc.12 --save getting below error
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-router-dom": "^5.1.2",

Please let me know how to fix this issue as I need to add multi tab session extension feature over my project. With react-idle-timer@4.6.4 The ideal event is not getting triggered for multiple tabs even if I provide
const idleMethods = useIdleTimer({
timeout:timeoutValue,
onIdle:(e) => _onIdle(e),
crossTab: true,
emitOnAllTabs: true,
onActive:_onActive,
onAction:_onAction,
startOnMount:true
})
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 47 (27 by maintainers)
Thanks! Works great now.
Okay noted. If you could take the time to recreate the issue in a stack blitz, I can work on fixing it. We will def want to resolve this before releasing v5 to GA.
It actually might be related to the name of the file. Can you try to change it in your local node_modules.
index.esm.jstoindex.jsand update it in thepackage.jsonas well?@SupremeTechnopriest This is how I’m using while running my app like npm run dev that time I’m getting this issue
test: /\.(js|jsx)$/,this looks like it should match just fine. Its something with the optional chaining.Can you also try updating babel/core to the latest. Worst case scenario I can compile the optional chaining out of the library, but it is widely supported now and would result in a larger package.
Can you try updating babel-preset-env to the latest
7.16.11Could you paste the error as plain text so I can parse it. Trying to find exactly where it’s failing.
Okay give me a little bit to investigate. Will get back to you shortly.