Vue-awesome-swiper: Parsing Error

Created on 7 Nov 2016  ·  6Comments  ·  Source: surmon-china/vue-awesome-swiper

Hi! I'm trying to implement your Slider, but I'm having some issues:

 SyntaxError: Unexpected token (2:0) while parsing ~/node_modules/vue-awesome-swiper/swiper.vue while parsing file:
 ~/node_modules/vue-awesome-swiper/swiper.vue

 ~/node_modules/vue-awesome-swiper/slide.vue:1
 <template>
 ^

Any reason why this is happening? I used the npm install method Thanks!

*Apologize for the basic question ^_^

Most helpful comment

Sorry, it may temporarily not support browserify

All 6 comments

same, i'm using browserify

use vue-cli init your vue peoject

@surmon-china that wasn't helpfull at all, and I think it wouldn't help because of this line : require('swiper/dist/css/swiper.css')
even using vue-cli if you choose the browserify template this line will generate the same error.

@mateomrqz I fixed it myself by requiring the components from the vue-awesome-swiper package using the old fashioned way :

components: { 'swiper': require('../../components/swiper/swiper.vue'), 'swiper-slide': require('../../components/swiper/slide.vue') }

some more adjustement were needed, let me know if you want more help.

@jbrialon Thank you so much! I temporarily fixed my issues by including the swiper.vue and slide.vue directly in my projects, not ideal, but allowed me to kept working. I will implement your suggestion today!

@surmon-china I used vue cli + browserify template and still the issue persists! This is an excellent slider for Vue, thank you so much!

Sorry, it may temporarily not support browserify

So this is still the case, you still don't support browserify? I'm still getting the same parsing error.

Was this page helpful?
0 / 5 - 0 ratings