Try using the unminifed jquery version to mix and see if you get the same results.
Sep 5, 2016
4
Level 33
Jquery undefined with elixir
Hi,
I use Laravel Elixir. I want to include Jquery but in my console I receive Uncaught ReferenceError: jQuery is not defined.
This is how my gulp file looks like:
elixir(function(mix) {
mix.browserify('main.js')
.styles([
'./node_modules/normalize.css/normalize.css',
'./node_modules/nprogress/nprogress.css',
'./node_modules/sweetalert/dist/sweetalert.css',
'./node_modules/animate.css/animate.min.css'
], 'main.css');
mix.scripts([
'./node_modules/jquery/dist/jquery.min.js',
], 'main.js');
});
I've checked the path:
./node_modules/jquery/dist/jquery.min.js
And the file is there. I also included this in my index.html:
<script src="/js/main.js"></script>
I've compiled everything. What could be wrong?
Please or to participate in this conversation.