Skip to content

Invalid regular expression @6460 vue.common.js #4511

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

Closed
ViktorPontinen opened this issue Dec 18, 2016 · 3 comments
Closed

Invalid regular expression @6460 vue.common.js #4511

ViktorPontinen opened this issue Dec 18, 2016 · 3 comments

Comments

@ViktorPontinen
Copy link

Vue.js version

2.1.6

Steps to reproduce

Using the standalone build; vue.common.js

Running following gulp task:

gulp.task('scripts', function(){
  return gulp.src('renderer/js/renderer.js')
    .pipe(plumber({
      errorHandler: function (error) {
        console.log(error.message);
        this.emit('end');
    }}))
    .pipe(browserify())
    .pipe(concat('main.min.js'))
    .pipe(gulp.dest('renderer/bundle/js/'))
    .pipe(browserSync.reload({stream:true}))
});

What is happening?

Parsing file ...\node_modules\vue\dist\vue.common.js: Line 6460: Invalid regular expression

And getting Failed to mount component: template or render function not defined. (found in root instance) in browser. Which probably means that Vue didn't get built correctly in the gulp task.

Checking vue.common.js im suspecting it's the following line @6459:

var regexEscapeRE = /[-.*+?^${}()|[\]/\\]/g;

"Debugs" attempted

Commenting the whole line out seems to remove both the gulp error and the browser error and makes vue run.

Adding an extra \ right after [\] like so:

var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;

also seems to remove gulp error, browser error and makes vue run.

@rekateka
Copy link

Not sure if this is related to this other one: #4445

@fnlctrl
Copy link
Member

fnlctrl commented Dec 19, 2016

Hi, thanks for filling this issue. That's a perfectly valid regex, so it's a bug of your js parser.

@fnlctrl fnlctrl closed this as completed Dec 19, 2016
@arielpchara
Copy link
Contributor

Vue version 2.1.8 still have this problem

yyx990803 pushed a commit that referenced this issue Jan 5, 2017
* fiz regular expression

* fix regular expression
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

4 participants