Module build failed: Module failed because of a eslint warning
eslint 设置 warning 级别,在 开发编译失败的原因,报错如下:
F:\vue-mobile-skeleton>npm run dev > byhealth@1.0.0 dev F:\vue-mobile-skeleton
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 94% asset optimization ERROR Failed to compile with 1 errors 22:51:17 error in ./src/app.vue Module build failed: Module failed because of a eslint warning. ⚠ http://eslint.org/docs/rules/no-unused-vars 'o' is assigned a value but never used
src\app.vue:60:7
const o = 90;
^ ✘ 1 problem (0 errors, 1 warning) Warnings:
1 http://eslint.org/docs/rules/no-unused-vars @ ./src/main.js 12:0-28
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
Module build failed: Module failed because of a eslint warning的原因,为自己当时即使是eslint 设置 warning 规则,在热更新都会报错,无法编译通过的!
解决:
1:把这个没有使用变量,删除
2:使用 注释方式不进行检测 => // eslint-disable-next-line
3:把 eslint-laoder 的选项设置 fasle 即可;
// 目录:/build/webpack.base.conf.js
const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitError:false,
emitWarning: config.dev.showEslintErrorsInOverlay,
fix: true,
failOnError: true,
//如果有eslint警告,加载器将导致模块构建失败。
//设置 false 即可,去除此检验
failOnWarning: false,
}
})
但是,还是看个人喜好,若是单单在控制台提示警告也可以,不过我本人不想看到有警告,所以就硬性设为 true 不让编译通过,个人喜爱而已!
Module build failed: Module failed because of a eslint warning的更多相关文章
- vue-cli 报Module build failed: Error: No parser and no file path given, couldn't infer a parser.错的解决方法
出错提示如下: ERROR Failed to compile with errors :: error in ./src/App.vue Module build failed: Error: No ...
- vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.
ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No ...
- 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.
报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...
- Vue使用Typescript开发编译时提示“ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'afterCompile' of undefined”的解决方法
使用Typescript开发Vue,一切准备就绪.但npm start 时,提示“ ERROR in ./src/main.tsModule build failed: TypeError: Cann ...
- webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-env' from '...' - Did you mean "@babel/env"?
webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find mo ...
- Module build failed: Error: Cannot find module 'url-loader' 的坑
本文地址:http://www.cnblogs.com/jying/p/8280956.html 开发环境:react.webpack.es5 引用图片报错:Module build failed: ...
- Vue, element-ui Module build failed: Error: No PostCSS Config found
使用vue框架写pc页面时,我们经常会用到element-ui这个框架. 当我们吧把需要的东西都装在好运行项目的时候,有时会出现这样的错误, Module build failed: Error: N ...
- Vue+Webpack配置css-loader时报错:Module build failed: Unknown word
使用Vue+Webpack搭建工程时,在webpack.config.js中的module的rules里针对各种文件配置加载工具.在针对css文件配置时遇到一个问题:打包构建时报错——Module b ...
- Module build failed: Error: Cannot find module 'node-sass'
安装npm 遇到 Module build failed: Error: Cannot find module 'node-sass' 这次通过重装 npm 完成 先卸载npm npm uninsta ...
随机推荐
- HDU 1385 Minimum Transport Cost( Floyd + 记录路径 )
链接:传送门 题意:有 n 个城市,从城市 i 到城市 j 需要话费 Aij ,当穿越城市 i 的时候还需要话费额外的 Bi ( 起点终点两个城市不算穿越 ),给出 n × n 大小的城市关系图,-1 ...
- 微信公众号开发之获取微信用户的openID
(注:openID同一用户同一应用唯一,UnionID同一用户不同应用唯一.不同应用指微信开放平台下的不同用户.) 1. 申请测试号(获得appID.appsecret) 2. 填写服务器配置并验 ...
- 简述JVM、JRE、JDK的关系及作用
1.JVM:java虚拟机 . 作用:保证java语言跨平台. 2.JRE:java运行环境 jre=java虚拟机+核心类库. 作用:java程序的运行环境. 3.JDK :java开发工具集.JD ...
- Hibernate 的核心配置文件
核心配置文件 <!-- SessionFactory,相当于之前学习连接池配置 --> <session-factory> <!-- 1 基本4项 --> < ...
- Centos6下创建Centos6基础镜像
在centos6下可以使用官方仓库拉取一个指定系统类型跟tag的镜像到本地 [root@localhost ~]# docker pull centos:6.8 6.8: Pulling from c ...
- python第二周:数据类型、列表、字典
1.模块初识: sys模块: import sys print(sys.path) #path打印环境变量--> ['F:\\python学习\\projects\\s14\\day2', 'F ...
- 2015 Multi-University Training Contest 8 hdu 5381 The sum of gcd
The sum of gcd Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)To ...
- POJ 4786 Fibonacci Tree
Fibonacci Tree Time Limit: 2000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ...
- oracle导入expdp、导出impdp数据库用户
仅限oracle服务器上执行:把172.16.251.136:1521/orcl的AMI4_2用户导入到192.168.2.30:1521/orclss中的AMI1用户: 关于导入导出更详细的见文章 ...
- jQuery Mobile页面跳转切换的几种方式
jQuery Mobile在移动开发中越来越受到欢迎. 而他的各个版本号也在持续不断的更新中.相同的我也非常喜欢它,它加快了我们开发HTML5的速度. 同一时候又具备jQuery一样的操作方法. 学起 ...