Home > other >  Exception Unable to locate Mix file: /employee/js/app.js
Exception Unable to locate Mix file: /employee/js/app.js

Time:05-09

I am trying to launch a laravel-vuejs app in another app domain by creating a folder named employee. But the problem is it's displaying the following error :

Exception Unable to locate Mix file: /js/app.js.

But while I changed

<script type="text/javascript" src="{{mix('js/app.js')}}"></script>

to

<script type="text/javascript" src="{{asset('js/app.js')}}"></script>

The app is now running, but the urls (generated in vue router) are returning not found

enter image description here

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:2UJgNPXhBDSDHgAWO2mdVEgRlbpuhSOyXMBfuEiZPfY=
APP_DEBUG=true
APP_URL=https://xxxxxxxxxx.com/employee/

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

CodePudding user response:

Check file name js/app.js is in file public/mix-manifest.json or not.

If not, run the command npm run prod or npm run dev to update the file mix-manifest.json

CodePudding user response:

Add bellow code at the end of laravel/routes/web.php

Route::get('/{path?}', 'YourHomeController@index')->where('path', '.*')
  • Related