javascriptvue.jsvue-componentlaravel-vue

Vue components not displaying in production, works well in dev env


I have a laravel vue project working quite well in development but on the live shared hosting server, vue components are not showing up but the laravel views work just fine. There is no error in the console. I ran npm run production to minified for production before deploying and also set the vue.config mode to production. I've tried other few suggestions I found on here; Hot reload browser, clearing browser cache, trying another shared hosting server but none worked for me. Any help would be appreciated. Here is my script object in package.json file enter image description here


Solution

  • So I discovered webpack was compiling to production with warnings that are not displaying. I got to know after adding this to my webpack.mix.js

    mix.webpackConfig({
            stats:{
            hash: true,
            children: true,
            errors: true,
            errorDetails: true,
            warnings: true,
            publicPath: true,
        }
        });
    

    Thereafter fixed the warnings and boom problem solved.