feross/yt-player

Gulp returning error when do minify

enoa7 opened this issue · 3 comments

enoa7 commented

Gulp is returning some 'Unhandled 'error' event' whenever I tried to minify the js file with YTP included. Anyone experiencing this?

here is my code:

// Gulp - Compile ES6
gulp.task('scripts', () => {
    return browserify({ entries: main-dev.js, debug: true })
        .transform(babel, { presets: ["es2015"] })
        .bundle()
        .on('error', onError)
        .pipe(source('main.js'))
        .pipe(buffer())
        .pipe(sourcemaps.init('loadMaps: true'))
        .pipe(jsOutput()) // if in production do uglifiy()
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest(jsPaths.dest))
        // .pipe(reloadBrowserSync);
});

And this is how i import the package

import $ from 'jquery';
import YTPlayer from 'yt-player';

//the rest of code

Hi @enoa7,

Had the same issue, i ran eslint --fix on the file and it worked. Did a PR on the matter #15

Hi @feross,

eslint --fix are not matching the the standard code pattern. Do you' ve any pointers on this matter?

For my project, running almost the same setup as @enoa7, I had to add yt-player as a static file to my project. It looks like this in my project

It's not possible to debug this issue without additional information. If this is still an issue, please leave a comment or open a new issue.