Home

Issue: 2891

Unable to use external Vue plugin

[issue link]

Trying to get the Dragabilly Vue plugin to work with my Nuxt site: https://www.npmjs.com/package/vue-draggabilly

I’ve used the usual approach that has worked with similar plugins but I don’t have the depth of knowledge to crack this one. I am adding into my nuxt config file:

 plugins: [
   { src: '~/plugins/vue-draggabilly.js', ssr: false }
  ]

That file includes this code:

import Vue from 'vue'
import VueDraggabilly from 'vue-draggabilly'

Vue.use(VueDraggabilly)

However, I get the following error and I’m not able to use:

vue-draggabilly.js:3 Uncaught ReferenceError: exports is not defined

This refers to this line in the plugin:

exports.install = function (Vue, options) { ....

Any help very greatly appreciated!

This question is available on Nuxt.js community (#c2513)