Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with browserify+vue? #58

Open
nocksock opened this issue Nov 25, 2016 · 0 comments
Open

Not working with browserify+vue? #58

nocksock opened this issue Nov 25, 2016 · 0 comments

Comments

@nocksock
Copy link

When I add this to my package.json to make Vue compatible with browserify:

  "browser": {
    "vue": "vue/dist/vue.common"
  },

I get this error:

/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:6268
            throw e;
            ^

Error: Line 6472: Invalid regular expression
    at throwError (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:2159:21)
    at scanRegExp (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:1343:13)
    at parsePrimaryExpression (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:2665:43)
    at /usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:5832:38
    at trackLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:5732:61)
    at parsePostfixExpression (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:2795:20)
    at /usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:5832:38
    at parseUnaryExpression (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:2859:16)
    at /usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:5832:38
    at parseBinaryExpression (/usr/local/lib/node_modules/disc/node_modules/esprima-fb/esprima.js:2947:16)

This is the relevant gulp-part:

function bundle(bundler) {
    return bundler
        .on('error', gutil.log)
        .transform("babelify", {presets: ["es2015"]})
        .bundle()
        .pipe(exorcist('./assets/js/dist/bundle.js.map'))
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('assets/js/dist'))
        .pipe(browserSync.stream())
}

gulp.task('js', function (done) {
    bundle(browserify({
        entries: config.js.entry,
        fullPaths: true,
        debug: config.debug
    }));
    return done();
});

gulp.task('js:disc', function() {
    return plugins.run('discify assets/js/dist/bundle.js --open > disc.html').exec();
})

And this is the Vue-Code:

import Vue from 'vue';

const app = new Vue({
    el: '.list',
    data: {
        items: ['123', '123', '333']
    }
});

However, when I remove the first mentioned lines from package.json, disc works (but vue.js does not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant