(solved) Unable to load plugins (plugin.apply is not a function error)



  • Having some issues getting my environment setup. I’m using cordova as a base, with vue, onsen ui components, and the vue-onsen bindings. I can get it to run as ios and android, it works when I just use a single vue component, but when I add in vue-onsen and onsen ui it get thrown some errors. I’m using Browserify as well. Below is my main.js where I am thinking the problem may lie. Would love some help, and I’m pretty new to all of this. Thanks!

    UPDATE - Solved

    var Vue = require('vue');
    var VueOnsen = require('vue-onsenui');
    var ons = require('onsenui');
    var MainPage = require('./MainPage.vue');
    var SecondPage = require('./SecondPage.vue');
    var App = require('./App.vue');
    
    Vue.use(Onsenui);
    Vue.use(VueOnsen, {
      components: {
        MainPage,
        SecondPage
      }
    });
    
    ons.ready(() => {
      new Vue({
        el: 'body',
        components: { App }
      });
    });