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

walidabou's avatar

vue components doesn't update on shared hosting server

Hello everyboy.

I'm facing a problem that is when i deployed my laravel 5.5/vuejs application i can't update the vue components. in the development mode i didn't encounter this problem because i run "npm run watch". but on real server (000webhost.com just for testing) how can i perform this command. what i'm doing right now is editing the components in my local server, run "npm run watch" and then uploading these two files (/public/css/app.css) and (/public/js/app.js) to the server. and it works but after cleaning browser cache which is another problem unfortunately.

"I'm using Vuejs which is built-in with laravel"

Is shared hosting appropriate to host apps that contain vue components or nodejs apps in general ? Or is this kind of applications require a hosting with powerful capabilities like forge and Digitalocean ?

If there is a ways or tips to fix these issues please help me.

0 likes
9 replies
Sanctuary's avatar

Before anything, you should understand the following:

  1. Shared hosting is not ideal when working with Laravel (it's possible to use it, but definitely not ideal).
  2. Most shared hosting sellers will never give you SSH access. This is one of the main reasons that shared hosting isn't ideal.
  3. Vue is not "built-in" with Laravel. There's basic scaffolding for it but they are each their own frameworks.

In the case of shared hosting, the solution is almost always "do it locally, upload it when done".

it works but after cleaning browser cache which is another problem unfortunately

Are you saying it only updates after you reupload the files and clear your cache? Because if so, that's very normal. If you don't want to constantly clear your cache, and don't want your users to have to do the same, you should look into cache busting: https://laravel.com/docs/5.6/mix#versioning-and-cache-busting

2 likes
walidabou's avatar

Thank you for your quick reply. Yes i know that Vuejs is a framwork in itself but, i prefere to use that which is buil-in with laravel, at least for now.

Also i know that shared hosting is not ideal when working with this kind of applications that contain some of vue or angular...etc. but , Now i'm just practicing and i want to test my apps how they work on real server and what problems can i encounter. So i have a question on this : If i have an application (laravel & vuejs for example) and it works correctly on my local server, does that mean it will work perfectly on real server without any problems ? And, are javascript framworks in general (vue angular react...etc) require Node js to be installed on the server (real server) ?

Thanks.

walidabou's avatar

"alex_giacholari" Yes i ran "npm run production" before delpoying. My problem is when i edit a vue component, it is not updated on the DOM even if i refresh the browser.

and also i'm still getting this message in console: "You are running Vue in development mode. Make sure to turn on production mode when deploying for production."

even if i ran "npm run production" before deploying.

Sanctuary's avatar

@walidabou You don't need Node installed on your production server to use JS frameworks, no.

Working locally and then trying to push straight to production when using different environments will more than likely not work exactly the same. However, as long as you set up your production server appropriately, you shouldn't have many issues.

When you say you're editing a Vue component, are you doing it locally, recompiling, and then uploading to your server, or are you doing it all on your server? If you're doing it all on your server, it's not updating because you need to recompile it before it'll take any effect.

1 like
walidabou's avatar

"Sanctuary", 'When you say you're editing a Vue component, are you doing it locally ?'

No i do it on the server.

'If you're doing it all on your server, it's not updating because you need to recompile it before it'll take any effect.'

So you mean that whenever i want to edit a component, i have to do it locally, run "npm run watch" and then uploading these two files (/public/css/app.css) and (/public/js/app.js) ? Is this normal?

walidabou's avatar

"alex_giacholari"

You mean that i have to keep a copy of my app on my computer so whenever i need some changes i do it locally and then uploading neccesarey files to the server, right ?

walidabou's avatar

"alex_giacholari"

But what if the host provide SSH access, Can i complie the assets by running "npm run watch" on the fly. Or not ?

Please or to participate in this conversation.