Static GitHub Issues

[371] TypeError: arguments[i].apply is not a function when adding a plugin

prev: SSR Sourcemap
next: "this" inside of a method returns an unexpected Object

I'm trying to use vuetify with nuxt.js.

After installing vuetify: $ npm install vuetify --save-dev

I added vuetify as vendor in nuxt.config.js and the plugin:

...
/*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLINT on save
    */
    vendor: ['vuetify'],
    plugins: ['~plugins/vuetify'],
    extend (config, ctx) {
      if (ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}

I created /plugins/vuetify.js and looks like this:

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

When I run the app

 $ npm run dev

I get the following error:

> website@1.0.0 dev /home/dev/go/src/bitbucket.org/latamvapor/vape-city/website
> nuxt

  nuxt:build App root: /home/dev/go/src/bitbucket.org/latamvapor/vape-city/website +0ms
  nuxt:build Generating .nuxt/ files... +2ms
Ready on http://localhost:3000
  nuxt:build Generating routes... +12ms
  nuxt:build Generating files... +11ms
  nuxt:build Adding webpack middleware... +15ms
TypeError: arguments[i].apply is not a function
    at Compiler.apply (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/tapable/lib/Tapable.js:306:16)
    at webpack (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/webpack/lib/webpack.js:32:19)
    at Nuxt.createWebpackMiddleware (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/nuxt/dist/nuxt.js:801:72)
    at Nuxt.buildFiles$ (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/nuxt/dist/nuxt.js:545:35)
    at tryCatch (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/regenerator-runtime/runtime.js:64:40)
    at Generator.invoke [as _invoke] (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/regenerator-runtime/runtime.js:299:22)
    at Generator.prototype.(anonymous function) [as next] (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/regenerator-runtime/runtime.js:116:21)
    at onFulfilled (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/co/index.js:65:19)
    at /home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/co/index.js:54:5
    at co (/home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/node_modules/co/index.js:50:10)

npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v7.4.0
npm ERR! npm  v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! website@1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the website@1.0.0 dev script 'nuxt'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the website package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     nuxt
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs website
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls website
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/dev/go/src/bitbucket.org/latamvapor/vape-city/website/npm-debug.log

If I remove plugins: '~plugins/vuetify' from nuxt.config.js

...
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLINT on save
    */
    vendor: ['vuetify'],
    extend (config, ctx) {
      if (ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}

The app runs.

Any tips?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c322">#c322</a>)</em></sub></div>