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

rickyspires's avatar

File public/css/all.css not defined in asset manifest ?

Hello. For some reason laravel can't find my css and js files. I am using Elixir and vessioning.

this is my code:

APP.BLADE.PHP

<link rel="stylesheet" type="text/css" href="{{ elixir('css/all.css') }}">
<script href="{{ elixir('css/all.js') }}"></script>
  • Note laracast has stripped out the link code from above but it looks like this: elixir('css/all.css') and elixir('css/all.js') in curly brackets

GULPFILE.JS

var elixir = require('laravel-elixir');

var paths = {
    'jquery': 'bower_components/jquery/dist',
    'bootstrap': 'bower_components/bootstrap/dist',
    'angular': 'bower_components/angular',
    'fontawesome': 'bower_components/font-awesome',
    'modernizr': 'bower_components/modernizr',
    'normalizecss': 'bower_components/normalize-css',
    'select2': 'bower_components/select2/dist'
}

elixir(function(mix) {

    mix.less('app.less', 'public/css/')
    .copy(paths.bootstrap + '/fonts/**', 'public/fonts')
    .coffee()

    .scripts([
    paths.jquery + "/jquery.min.js",
    paths.bootstrap + "/js/bootstrap.min.js",
    paths.modernizr + "/modernizr.js",
    paths.angular + "/angular.min.js",
    paths.select2 + "/js/select2.min.js"
    ],'public/css/all.js', './')

    .styles([
    'public/css/app.css',
    paths.bootstrap + "/css/bootstrap.css",
    paths.fontawesome + "/css/font-awesome.css",
    paths.normalizecss + "/normalize.css",
    paths.select2 + "/css/select2.min.css"
    ],'public/css/all.css', './');

    //version control & cache 
    mix.version('public/css/all.js');
    mix.version('public/css/all.css');

});

BOWERRC.JS

{
"directory": "bower_components"
}

THIS IS MY ERROR

ErrorException in helpers.php line 676: File css/all.css not defined in asset manifest. (View: /home/vagrant/Code/laravel5-demo-project/resources/views/app.blade.php) (View: /home/vagrant/Code/laravel5-demo-project/resources/views/app.blade.php)

Thank you Ricky

0 likes
5 replies
Jeffberry's avatar

We still can't see how you have your source tags set up in your app.blade.php, but they should look something like this:

{ { elixir('css/all.css') } }
{ { elixir('js/all.js') } }

I noticed that you are compiling your javascript to public/css/all.js too, I'm guessing that's unintentional.

rickyspires's avatar

Hello. Thanks for your reply. I have corrected the compile location error. thanks for spotting that one ;)

my app.blade.php file look the same as you have it in your comment.

{ { elixir('css/all.css') } }
{ { elixir('js/all.js') } }

Its strange. This morning the CSS WORKS but the JS IS NOT? i tried this:

<link rel="stylesheet" type="text/css" href="{ { elixir('public/css/all.css') } }">  //WORKS
<script src="{ { elixir('js/all.js') } }"></script> //DOESN'T WORK

if I do this it works

gulpfile

var elixir = require('laravel-elixir');

var paths = {
 'jquery': 'bower_components/jquery/dist',
 'bootstrap': 'bower_components/bootstrap/dist',
    'angular': 'bower_components/angular',
    'fontawesome': 'bower_components/font-awesome',
    'modernizr': 'bower_components/modernizr',
    'normalizecss': 'bower_components/normalize-css',
    'select2': 'bower_components/select2/dist'
}

elixir(function(mix) {

    mix.less('app.less', 'public/css/')
    .copy(paths.bootstrap + '/fonts/**', 'public/fonts')
    .coffee()

    .scripts([
    paths.jquery + "/jquery.min.js",
    paths.bootstrap + "/js/bootstrap.min.js",
    paths.modernizr + "/modernizr.js",
    paths.angular + "/angular.min.js",
    paths.select2 + "/js/select2.min.js"
    ],'public/js/all.js', './')

    .styles([
    'public/css/app.css',
    paths.bootstrap + "/css/bootstrap.css",
    paths.fontawesome + "/css/font-awesome.css",
    paths.normalizecss + "/normalize.css",
    paths.select2 + "/css/select2.min.css"
    ],'public/css/all.css', './');

    //version control & cache 
    mix.version('public/js/all.js');
    mix.version('public/css/all.css');

});

?

1 like
rickyspires's avatar

I found the reason.

i was doing this: mix.version('public/css/all.css'); mix.version('public/js/all.js');

i should have done this: mix.version(["css/all.css", "js/all.js"]);

now it works :)

14 likes
kolovious's avatar

I think that differents call's of version, regenerate the rev.manifest.json o something like that. That's why the solution of versioning all together works.

mix.version(["css/all.css", "js/all.js"]);

4 likes
tarunn's avatar

I have a doubt here, I am very novice in using elixir and stuff. I want to know as you had defined the path variable in gulpfile.js. Where actually these folders reside, is it inside:

/laravel/resources/assets/bower_components 

OR

/laravel/public/bower_components

Also where to create/keep BOWERRC.JS file. Any guiding/explanation would be much appreciated

Please or to participate in this conversation.