:
vue family barrel USES the vue-qrcode-directive component to generate the two-dimensional code in the project. There is no error in using NPM run dev in the development process. To NPM run build packaging ERROR, such as the ERROR in the static/js/app f1ecb9a5673e78cc442b. Js from UglifyJs Unexpected token: operator (& gt;) [./~/_vue – [email protected] @ vue – qrcode – directive/index, js: 4, 0] [static/js/app. F1ecb9a5673e78cc442b. Js: 17412] p>
analysis reason strong> :
weback default webpack. Optimize. UglifyJsPlugin cannot compress es6 code files. Along the way, we can simply convert es6 code to ES5 using Babel.
the reason must still be on webpack.config.js. After repeated observations. The problem occurred in the loader configuration, where an item was configured for js file transformation.
solution : (the same problem occurs in _quill-image-drop-module, _vue-qrcode-directive)
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
include: [
resolve("src"),
resolve("test"),
resolve(
"node_modules/[email protected]@quill-image-drop-module"
),
resolve(
"node_modules/[email protected]@vue-qrcode-directive"
)
],
}
]
}
div>
Read More:
- Unexpected token appears in JS
- JS error: unexpected token u in JSON at position 0
- chunk-vendors.7142f8da.js:1 Uncaught SyntaxError: Unexpected token ‘<‘
- Syntax error: unexpected token in uni app project compilation
- Baidu editor echo JS error uncaught syntax error: invalid or unexpected token
- How to read JS file app.ux Global variables in
- node.js Static resource acquisition failed
- Module build failed: SyntaxError: Unexpected token
- JS uses the and or operator, and an error is reported: uncaught rangeerror: maximum call stack size exceeded
- [W xx:xx:xx.xxx NotebookApp] 404 GET/static/components/react/react-dom.production.min.js (::1)
- ./src/App.js Line 13:11: Parsing error: Unterminated JSX contents (react)
- egg.js The frame post request reported an error of invalid CSRF token security verification, which has been solved
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- ERROR Invalid options in vue.config.js: “plugins“ is not allowed
- After NPM run dev is running, the browser does not respond and reports an error in. / ~ / Babel loader / lib! / ~ / Vue loader / lib/ selector.js?type=script&in
- ERROR in ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/css/spec
- Module build failed (from ./node_modules/babel-loader/lib/index.js) babel-loader
- Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘
- Error resolution of unexpected token in JSON at position 0
- Cannot find module ‘.. / lib / utils / unsupported. JS’ problem in installing node in centos7