Agontuk / vue-cropperjs

A Vue wrapper component for cropperjs https://github.com/fengyuanchen/cropperjs
MIT License
937 stars 224 forks source link

vendors.app.js:formatted: Uncaught ReferenceError: exports is not defined #49

Closed nelsonlarocca closed 4 years ago

nelsonlarocca commented 5 years ago

The error is triggered at vendorsapp.js line content: Object.defineProperty(exports, "__esModule", { value: true });


// /nuxt.config.js module.exports = { plugins: [ { src: '~/plugins/vue-cropper', ssr: false } ], build: { transpile: [ 'vue-cropperjs' ], } }

// plugins/vue-cropper.js import Vue from 'vue'; import VueCropper from 'vue-cropperjs'; Vue.use(VueCropper);

I also got: WARN in ./plugins/vue-cropper.js friendly-errors 14:51:25

"export 'default' (imported as 'VueCropper') was not found in 'vue-cropperjs'

using Nuxt ver 2.8.x

Thanks !

Agontuk commented 5 years ago

Can you provide a example repo which can reproduce this issue ? I haven't yet used Nuxt.js so need a sample project to test it.

nelsonlarocca commented 5 years ago

same to me, any fix ? thanks

Agontuk commented 4 years ago

Closing due to inactivity, it should be ok now.

stevenferrer commented 3 years ago

I think it doesn't work when you use it as a nuxt plugin. But it works when you import it as a local component. Just make sure to wrap it inside <client-only></client-only>