The Mix manifest does not exist
See original GitHub issue- Laravel Mix Version: 1.6.2
- Node Version : 8.4.0
- NPM Version : 5.3.0
- OS: Ubuntu 16
- Laravel version : 5.4
Description:
I’m trying to install Laravel in a sub-directory, keeping security in mind, my directory structure is as follows
/var/www/laravel/
/var/www/html/demo/
(demo folder is where i prefer to be called as public folder. and things works like a charm except this mix issue.)
After i run npm run dev it creates mix-manifest.json in /var/www/html/demo/ directory along with css and js directories with compiled files.
in my views/auth/layout.blade.php , i have called the versioned asset like this.
<link href="{{ mix('/css/app.css') }}" rel="stylesheet">
And when i reload the page, it says
The Mix manifest does not exist.
in helpers.php (line 548)
at mix('/css/app.css')
in my /var/www/html/demo/ folder, the manifest exists.
{
"/js/app.js": "/js/app.js?id=62141ada8b6feb788550",
"/css/app.css": "/css/app.css?id=26d13f158c3bade2b2d3",
}
and here is my webpack.mix.js file contents
let mix = require('laravel-mix');
let path = require('path');
mix.setPublicPath(`..${path.sep}html/demo/`);
mix.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css').version();
- I can call the css file directly, (
<link href="{{ asset('css/app.css') }}" rel="stylesheet">). It works, but i prefer to call with mix versioning. - I can call the css file
<link href="{{ asset('css/app.css') }}" rel="stylesheet">. It works too. But not with mix. - I have tried settings the
mix.setResourceRoot('../html/demo/');and it didnt help. - I have tried
https://stackoverflow.com/a/45154015but it doesn’t help either (<link rel="stylesheet" href="{{ mix('css/app.css', '../html/demo') }}">)
Steps To Reproduce:
Install Laravel outside root. (/var/www/laravel)
Assume example.com as the server.
Create sub directory as example.com/demo/ (/var/www/html/demo)
Move Files in /var/www/laravel/public folder to /var/www/html/demo
Change paths in demo/index.php
require __DIR__.'../../../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'../../../laravel/bootstrap/app.php';
Install packages with npm
"laravel-mix": "^1.6.2"
Webpack.mix.js content.
let path = require('path');
mix.setPublicPath(`..${path.sep}html/demo/`);
mix.js('resources/assets/js/app.js', 'js')
.sass('resources/assets/sass/app.scss', 'css').version();
run npm dev
It should compile files into /var/www/html/demo folder and create mix-manifest.json file with above mentioned content.
Access example.com/demo/
It should produce the error.
Please help fix this. Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:19

Top Related StackOverflow Question
I solved in windows with:
Install php 7 e update older path that point older version
unistall e re-install node.js (not last 9 version that seem have a bug with npm)
Fresh laravel installation 5.5
Php artisan preset react (just this by cli)
Npm install Npm run dev
Now i can compile e use react in my laravel
Even with the package being auto discovered you need still to run.
php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"Then re-runyarn devornpm run dev