question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order of vendor loading

See original GitHub issue

I am using Bootstrap-sass (laravel). This requires jQuery. When I load the page, it keeps saying that bootstrap-sass needs jQuery, even though it has been loaded. However, jQuery comes after Bootstrap in vendor.js.

This is my mix:

mix.js('resources/assets/js/app.js', 'public/js')
   .extract(['jquery', 'vue', 'vue-cookie', 'vue-resource', 'axios', 'lodash', 'moment', 'autosize', 'bootstrap-sass'])
   .sass('resources/assets/sass/app.scss', 'public/css');

Is there a way to load jQuery first?

Also… The Vue interceptor gives a Uncaught TypeError: Cannot read property 'interceptors' of undefined error:

Vue.http.interceptors.push((request, next) => { // Here
    request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);

    next();
});

Vue is being defined in the laravel bootstrap.js. Will this compile automaticly? I require it inside app.js.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

9reactions
jeff-hcommented, Mar 2, 2017

Any chance mix could respect the order the vendor libraries are specified in the extract array? I don’t think this problem is going to go away — I’m using Bootstrap 4, which depends on Tether, and their order is wrong in my vendors.js.

If I could fix this by putting tether first in my extract array, it would be great!

   .extract(['tether', 'bootstrap', 'axios', 'vue'])
7reactions
nmfzonecommented, May 10, 2017

This isn’t an issue, It’s just because since 0.9.0 (I think), jQuery has been removed from Webpack Provided plugin. See here.

So, if you need jQuery to be autoloaded, you could place this in your webpack.mix.js.

.autoload({
    jquery: ['$', 'jQuery', 'jquery'],
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

vendor loading date on standard raw material PO
In normal Pruchasing we have only information about delivery date whihc means the Material shoud be in our inventory on the delivery date....
Read more >
Order of vendor loading · Issue #38 · laravel-mix ... - GitHub
I am using Bootstrap-sass (laravel). This requires jQuery. When I load the page, it keeps saying that bootstrap-sass needs jQuery, ...
Read more >
Purchase order processes: common issues and best practices
A purchase order (or “PO”) is a document created by a buyer showing what it hopes to acquire from a supplier. It's essentially...
Read more >
vendor load-in / load-out instructions – electrical ordering
VENDOR LOAD -IN / LOAD-OUT INSTRUCTIONS – ELECTRICAL ORDERING. ALL vendors and contractors are required to check in at our Point of Entry...
Read more >
Vendor Configuration, Ordering, and Receiving
Only if Default Vendor: The purchase price is updated during a catalog load only if the vendor is set as the Default Vendor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found