I am working on webpack 4.29.3 and vue.js 2.6.3. I just tried to create a simple hello world project with vue js and webpack. I expected index.html to be rendered well. I get the error, though: SyntaxError: invalid range in character class which is really weird because I don't do anything with regular expression. that's why I am not sure which part to fix it.
vue-first.js:
import Vue from 'vue';
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
});
index.html:
<!doctype html>
<html>
<head>
<title>Getting Started</title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<script src="todo.js"></script>
</body>
</html>
webpack.config.js
const path = require('path');
module.exports = {
entry: './src/js/vue-first.js',
output: {
filename: 'todo.js',
path: path.resolve(__dirname, 'dist')
}
};
package.json
{
"name": "vue-first",
"version": "1.0.0",
"description": "",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.29.3",
"webpack-cli": "^3.2.3"
},
"dependencies": {
"vue": "^2.6.3"
}
}
the full error message (from Safari) :
[Error] SyntaxError: Invalid regular expression: range out of order in character class
RegExp (todo.js:7:3226)
(anonymous function) (todo.js:7:3226)
(anonymous function) (todo.js:7:63703)
n (todo.js:1:115)
(anonymous function) (todo.js:7:63775)
n (todo.js:1:115)
(anonymous function) (todo.js:1:904)
Global Code (todo.js:1:912)
for more detail, you can checkout my Github.
npm run buildandnpx webpackworks fine. it happens in the line 7 fromtodo.js. I've listed the full error message. Thank you in advance.todo.js? (No such file on your github repo.) And enable map files for your JS so the browser can give you the pre-minification/packing source code reference.