lekhang2512 / vue-upload-multiple-image

A simple upload multiple image component for Vuejs
132 stars 50 forks source link

passenger error: Unexpected token import #35

Open dwfee opened 4 years ago

dwfee commented 4 years ago

I want to use your component within a nuxt project. Everything work fine, exept when I reload a link to a page where the component is used. Then I get passenger error: Unexpected token import. I importet the component directly on this page. All my trials to register the component befor as a plugin, did not work. I guess there must be some import statements at the beginning of vue-upload-multiple-image passenger does not like. Passenger accepts only require. Any idea to fix this? How to make it work with nuxt using express server over passenger? When transpiling 'vue-upload-multiple-image','vue-image-lightbox-carousel','vue-awesome-swiper', I end up getting window is not defined from vue-awesome-swiper.js

dwfee commented 4 years ago

Fixed it myself. Using an async Component: const VueUploadMultipleImage = () => ({ component: import('vue-upload-multiple-image'), loading: Loading, // not work error: Error, // good delay: 10, // not work timeout: 3000 // good });