henkjanwils / metisMenu-error

0 stars 0 forks source link

metisMenu error #1

Open onokumus opened 4 years ago

onokumus commented 4 years ago

There is an error in the following lines in the app/javascript/packs/application.js file.

import 'assets/javascripts/vendor.js'
import 'assets/javascripts/app.js'

Here the webpack puts the app.js file top. So metisMenu is called before metisMenu is loaded. My advice is to load the vendor.js file contents as separate modules.

henkjanwils commented 4 years ago

It works! putting the app.js and the vendor.js to app/javascript/packs resolves the error.

I'll still research a bit more since I think it is not a best practise to get away of the application.js

onokumus commented 4 years ago

Sounds good.