Search code examples
laravelvuejs2

Laravel / VueJs 2 Latest changes not rendering on live server IONOS


I am working on Laravel / VueJs (version 2) and when I uploaded my files to the live server it WORKED! awesome, BUT the problem is now I am making changes to components and added more features that are working on my local, and when I uploaded those files to live again it doesn't show new changes. still showing older things... any idea how to fix that, please? I am stuck on this for 2 days I have checked by clearing browser cache, hard reload, cookies

NOTE: I also uploaded files after running npm run dev and npm run watch but no success :(

My Welcome.blade.php

    <div id="app" >
        <main-component></main-component>
    </div>
    <script src="{{mix('js/app.js')}}" ></script>

Webpack.mix.js

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .version();

Solution

  • I solved it, answering so anyone in the future could get help maybe. as I was having a server cache issue so version laravel will not work here... I have changed how my assets loaded

    <script src="{{asset('js/app.js?v='.time())}}" ></script>
    

    compiled assets again by running npm run production and reuploaded public folder