soixantecircuits / idle-vue

Vue component wrapper for idle-js
MIT License
125 stars 40 forks source link

Not working when deployed to server. Anyone has this issue? #52

Open hubert17 opened 2 years ago

hubert17 commented 2 years ago

Hello. Is there anyone of here have this issue where idle-vue works great in localhost but not in server? Thanks.

hubert17 commented 2 years ago

I'm using Vite. Sad. :(

gabrielstuff commented 2 years ago

hello,

idle-vue is a client side plugin. Not sure why you faced issue related to server. Any code to reproduce ?

paceband commented 2 years ago

Same issue. It's stopped completly working from the time I migrated from vue-cli/webpack to "vite".

This solution works for me:

npm install / build and that's it!

I do not know the exact source of the problem but that solved it!

juhasev commented 1 year ago

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)
        },