项目执行npm run serve/dev的图一点影响没有 跑起来之后页面也非常的正常
然后就来到了打包环境 执行打包命令
报这种错误
- htmlparser.js:255 HTMLParser.parse
[mydemo]/[html-minifier-terser]/src/htmlparser.js:255:15
- runMicrotasks
- task_queues.js:95 processTicksAndRejections
internal/process/task_queues.js:95:5
- htmlminifier.js:1282 async minify
[mydemo]/[html-minifier-terser]/src/htmlminifier.js:1282:3
- htmlminifier.js:1365 async Object.exports.minify
[mydemo]/[html-minifier-terser]/src/htmlminifier.js:1365:16
Failed to compile with 1 error 下午1:16:56 Error: Parse Error: <meta http-equiv="X-UA-Compatible" content="IE=edge" <meta name="viewport" content="width=device-width,initial-scale=1.0"> <link rel="icon" href="/favicon.ico"> <title>mydemo</title> <script defer src="/js/chunk-vendors.7fb67861.js"></script><script defer src="/js/app.3a9203cb.js"></script><link href="/css/chunk-vendors.ab49d789.css" rel="stylesheet"><link href="/css/app.a6c53255.css" re l="stylesheet"></head> <body> <noscript> <strong>We're sorry but mydemo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> </noscript> <div id="app"></div> <!-- built files will be auto injected --> </body> </html> - htmlparser.js:255 HTMLParser.parse [mydemo]/[html-minifier-terser]/src/htmlparser.js:255:15 - runMicrotasks - task_queues.js:95 processTicksAndRejections internal/process/task_queues.js:95:5 - htmlminifier.js:1282 async minify [mydemo]/[html-minifier-terser]/src/htmlminifier.js:1282:3 - htmlminifier.js:1365 async Object.exports.minify [mydemo]/[html-minifier-terser]/src/htmlminifier.js:1365:16 ERROR Error: Build failed with errors. Error: Build failed with errors. at D: est demomydemo ode_modules@vuecli-servicelibcommandsuildindex.js:207:23 at D: est demomydemo ode_moduleswebpacklibwebpack.js:148:8 at D: est demomydemo ode_moduleswebpacklibHookWebpackError.js:68:3 at Hook.eval [as callAsync] (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:6:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D: est demomydemo ode_modules apablelibHook.js:18:14) at Cache.shutdown (D: est demomydemo ode_moduleswebpacklibCache.js:150:23) at D: est demomydemo ode_moduleswebpacklibCompiler.js:1225:15 at Hook.eval [as callAsync] (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:6:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D: est demomydemo ode_modules apablelibHook.js:18:14) at Compiler.close (D: est demomydemo ode_moduleswebpacklibCompiler.js:1218:23) at D: est demomydemo ode_moduleswebpacklibwebpack.js:147:16 at finalCallback (D: est demomydemo ode_moduleswebpacklibCompiler.js:441:32) at D: est demomydemo ode_moduleswebpacklibCompiler.js:458:13 at Hook.eval [as callAsync] (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:24:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D: est demomydemo ode_modules apablelibHook.js:18:14) at onCompiled (D: est demomydemo ode_moduleswebpacklibCompiler.js:456:21) at D: est demomydemo ode_moduleswebpacklibCompiler.js:1196:17 at Hook.eval [as callAsync] (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:6:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D: est demomydemo ode_modules apablelibHook.js:18:14) at D: est demomydemo ode_moduleswebpacklibCompiler.js:1192:33 at finalCallback (D: est demomydemo ode_moduleswebpacklibCompilation.js:2787:11) at D: est demomydemo ode_moduleswebpacklibCompilation.js:3092:11 at Hook.eval [as callAsync] (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:6:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D: est demomydemo ode_modules apablelibHook.js:18:14) at D: est demomydemo ode_moduleswebpacklibCompilation.js:3085:38 at eval (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:15:1) at eval (eval at create (D: est demomydemo ode_modules apablelibHookCodeFactory.js:33:10), <anonymous>:14:1) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:95:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: `vue-cli-service build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
这个错怎么说呢 一般是不会发生的 发生这个错误的原因也非常的抽象 是手误的原因。public文件夹下的index.html文件 问题就出在这里 解析东西 插入东西发生了失败。能正常的跑应该是浏览器或者跑的那个服务有个校准或者忽略的功能 但是打包的确没有
图上是页面注意看框起来的 不小心删了一个结束标签 引发了这一系列的错误 补上就能解决这个报错。