记录:vue.config.js 中eslint配置错误导致的问题 Child compilation failed:

Error: Child compilation failed:
 Module parse failed: Unexpected token (1:0)
 File was processed with these loaders:
  * ./node_modules/html-webpack-plugin/lib/loader.js
  * ./node_modules/eslint-loader/index.js
 You may need an additional loader to handle the result of these loaders.
 > <!DOCTYPE html>
 | <html lang="en">
 |   <head>:
 SyntaxError: Unexpected token (1:0)

 - compiler.js:79
   [web_vant]/[html-webpack-plugin]/lib/compiler.js:79:16

 - Compiler.js:343
   [web_vant]/[webpack]/lib/Compiler.js:343:11

 - Compiler.js:681
   [web_vant]/[webpack]/lib/Compiler.js:681:15


 - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [web_vant]/[tapable]/lib/Hook.js:154:20

 - Compiler.js:678
   [web_vant]/[webpack]/lib/Compiler.js:678:31


 - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [web_vant]/[tapable]/lib/Hook.js:154:20

 - Compilation.js:1423
   [web_vant]/[webpack]/lib/Compilation.js:1423:35


 - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [web_vant]/[tapable]/lib/Hook.js:154:20

 - Compilation.js:1414
   [web_vant]/[webpack]/lib/Compilation.js:1414:32


 - Hook.js:154 AsyncSeriesHook.lazyCompileHook
   [web_vant]/[tapable]/lib/Hook.js:154:20

 - Compilation.js:1409
   [web_vant]/[webpack]/lib/Compilation.js:1409:36

错误如上:
原因:
同时配置了:
关闭eslint
在这里插入图片描述
elsint修复:
在这里插入图片描述
解决删除其中任意一个配置,或者将lintOnsave:false,改为 lintOnsave:“error”

猜你喜欢

转载自blog.csdn.net/weixin_39854011/article/details/112448148