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 ...
随机推荐
- js通过String取得对应全局Object的值
//假设有个全局对象Person var Person = { 'name' : 'alice' } //通过某种配置,获得了字符串形式的对象名 var thisPerson = 'Person'; ...
- HDU1867 - A + B for you again
Generally speaking, there are a lot of problems about strings processing. Now you encounter another ...
- [洛谷 P2365] 任务安排 (线性dp)
3月14日第二题!! 题目描述 N个任务排成一个序列在一台机器上等待完成(顺序不得改变),这N个任务被分成若干批,每批包含相邻的若干任务.从时刻0开始,这些任务被分批加工,第i个任务单独完成所需的时间 ...
- RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第七篇【元素定位介绍】
http://blog.csdn.net/deadgrape/article/details/50628113 我想大家在玩自动化的时候最关心的一定是如何定位元素,因为元素定位不到后面的什么方法都实现 ...
- 如何计算合适的InnoDB log file size
原文链接:http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size/ Pe ...
- 操作服务器及MySQL数据库可以使其远程链接
转自原文操作服务器及MySQL数据库可以使其远程链接 一般情况分三个地方准备,MySQL数据库,防火墙,还有你的服务器主机的准备 操作系统为centos6.5.其他系统大致差不多. 1:在服务器中安装 ...
- Qt Quick 之 QML 与 C++ 混合编程具体解释
Qt Quick 技术的引入.使得你能够高速构建 UI ,具有动画.各种绚丽效果的 UI 都不在话下.但它不是万能的.也有非常多局限性,原来 Qt 的一些技术,比方低阶的网络编程如 QTcpSocke ...
- HDU 1042.N!【高精度乘法】【8月24】
N! Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N ...
- MMORPG大型游戏设计与开发(server 游戏场景 事件)
游戏截图 场景事件 一个完整的对象一般都拥有事件,至于什么是事件在这里就不多解释了. 在场景中的事件在天龙/武侠世界中的事件包含场景初始化.场景定时器.场景退出.玩家进入场景.角色升级.角色死亡.角色 ...
- iOS_自己定义毛玻璃效果
终于效果图: 关键代码: UIImage分类代码 // // UIImage+BlurGlass.h // 帅哥_团购 // // Created by beyond on 14-8-30. // C ...