andrewvasilchuk / vue-lazy-youtube-video

Vue.js component for lazyloading YouTube videos.
MIT License
102 stars 22 forks source link

NPM: Module parse failed: Unexpected token #12

Closed songoo closed 4 years ago

songoo commented 4 years ago

Hello,

After clean install, when trying to use npm run watch. Any advice welcomed :) .

ERROR in ./node_modules/vue-lazy-youtube-video/dist/vue-lazy-youtube-video.esm.js
Module parse failed: Unexpected token (130:33)
You may need an appropriate loader to handle this file type.
|                     ? h('iframe', {
|                         staticClass: 'y-video__media',
|                         attrs: { ...iframeAttributes, src: srcAttribute },
|                     })
|                     : [
 @ ./src/app.js 43:27-60
songoo commented 4 years ago

At the 130:33, seem's I am hitting ... three dots issue ? https://imgur.com/a/oSndxUg

songoo commented 4 years ago

Hmm... Seems babel@6 does not support spread ... operator, 'spread' plugin for @6 doesn't work also, and migration from babel@6 to babel@7 didn't go well for me, so I guess there is no help :) Since it's not directly this plugin issue, it's just lack of support of new syntax :( .

songoo commented 4 years ago

@1.3version seems to work ok.

andrewvasilchuk commented 4 years ago

@songoo, Thanks for reporting. Seems like this issue is related to your bundler. Notice, that there is dist/vue-lazy-youtube-video.min.js file, which has no spread operator, so you can try to import this file directly.

andrewvasilchuk commented 4 years ago

@songoo, Can we close the issue?)