idle-vue icon indicating copy to clipboard operation
idle-vue copied to clipboard

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

Open hubert17 opened this issue 3 years ago • 4 comments

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

hubert17 avatar Jan 05 '22 21:01 hubert17

I'm using Vite. Sad. :(

hubert17 avatar Jan 05 '22 21:01 hubert17

hello,

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

gabrielstuff avatar Jan 06 '22 02:01 gabrielstuff

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!

paceband avatar Feb 03 '22 02:02 paceband

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

juhasev avatar Feb 14 '23 19:02 juhasev