Marvin Caspar
Marvin Caspar

Reputation: 1409

Gulp scripts with jquery doesn't work

I try to use gulp in my new laravel project. Laravel uses by default the laravel-elixir package.

Here is is gulpfile.js:

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

elixir(function(mix) {
  mix
    .sass([
      "app.scss"
    ])
    .scripts([
      "vendor/jquery-2.1.4.min.js",
      "app.js",
    ], 'public/js/app.js')
    .version([
      "css/app.css",
      "js/app.js",
    ]);
});

After running gulp in the terminal and visiting the page, the css file is successfully loading but I get a 403 error while loading the js file. I include the version build of the js via <script src="{{ elixir('js/app.js') }}"></script> and the file which wants to load exists. If i remove the line where I include jquery, everything works fine.

I can fix this problem temporary by running chmod -R 777 public/build/ but after running gulpagain I get the same error again.

Any ideas how to fix this problem?

Upvotes: 2

Views: 1025

Answers (1)

Marvin Caspar
Marvin Caspar

Reputation: 1409

After hours of testing I found the solution.

The jquery file in resources/assets/js/vender has 640 permissions. It looks like that the permissions are taken for the first file in the scripts array. I changed the jquery permissions to 664 and now it works fine.

Upvotes: 5

Related Questions