Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

Debugging VueJS

I have below code in my VueJS application.

mounted(){

alert('Hello');

        setTimeout(()=>{
            if(this.story.user_id != this.authId){
            axios.post('/api/story/visitors/counted',{
                    story_id : this.story.id
                });
            }
        },[5000])
    },

But I am not getting any alert. Should I run npm run dev command ?

0 likes
3 replies
Ortzinator's avatar

You should be running npm run dev every time you change the code. Are you doing that?

1 like
eterlinden's avatar

Actually, you should be run npm run watch instead. Every time it detects a change it will automatically recompile all your assets.

1 like

Please or to participate in this conversation.