Not working when deployed to server. Anyone has this issue?
Opened this issue · 4 comments
hubert17 commented
Hello. Is there anyone of here have this issue where idle-vue works great in localhost but not in server? Thanks.
hubert17 commented
I'm using Vite. Sad. :(
gabrielstuff commented
hello,
idle-vue
is a client side plugin. Not sure why you faced issue related to server. Any code to reproduce ?
paceband commented
Same issue. It's stopped completly working from the time I migrated from vue-cli/webpack to "vite".
This solution works for me:
- Include this file in my projet: https://github.com/soixantecircuits/idle-vue/blob/master/src/index.js
- Replace "import IdleVue from 'idle-vue';" with "import IdleVue from '[DIRECTORY OF THE FILE]/idle-vue';"
- In package.json replace "idle-vue": "^2.0.5" with "idle-js": "^1.2.0",
npm install / build and that's it!
I do not know the exact source of the problem but that solved it!
juhasev commented
Same issue here. We also switched to Vite and this stopped working completely. Our use case was simple so I just replaced this package with a simple @mousemove watcher with timeout to set user back to idle.
mouseMove() {
if (this.lastMouseMoveTimeout) clearTimeout(this.lastMouseMoveTimeout)
if (this.userIdle) this.setUserActive();
this.lastMouseMoveTimeout = setTimeout(() => {
this.setUserIdle();
}, 1000 * USER_IDLE_SECONDS)
},