node.js - 我用react-redux写的项目,在控制台release -cw的时候显示错误了,但是还是能继续执行(更新了)

查看:191
本文介绍了node.js - 我用react-redux写的项目,在控制台release -cw的时候显示错误了,但是还是能继续执行(更新了)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

标题不能写的太长,我重新说明一下我的问题吧:)
我用react-redux写了一个项目,在控制台发布的时候(-cw监听了),改着改着,就报错了

 Ω [BABEL] Note: The code generator has deoptimised the styling of "/node_modu
es/antd/dist/antd.js" as it exceeds the max of "100KB".

 [ERROR] Cannot read property 'substr' of undefined

当时我也没有管他,就继续改了,发现页面也是可以更新,有变化。然后,我把release -cw关了,再重新fis3 release 就错误了,不能下去了(Warning不用管)

E:\mavenWorkspace\labsforce\FrontEnd\modules>fis3 release -cw

 [INFO] Currently running fis3 (E:\Software\Nodejs\node_global\node_modules\.fis
3_npminstall\fis3\3.4.17\fis3\)

 δ 1736ms

 δ 0ms

 Ω ............................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.....
 [WARNI] Can't resolve `id` in file [/static/js/require.js], did you miss `npm i
nstall id`?
................................................................................
................................................................................
..........................................................................
 [WARNI] Can't resolve `libs/scrollspy` in file [/widget/sidebarmenus/sidebarmen
us.js], did you miss `npm install libs`?
.....
 [WARNI] Can't resolve `xhr2` in file [/node_modules/reqwest/reqwest.js], did yo
u miss `npm install xhr2`?
..............................[BABEL] Note: The code generator has deoptimised t
he styling of "/node_modules/antd/dist/antd.js" as it exceeds the max of "100KB"
.

 [ERROR] Cannot read property 'substr' of undefined

请问,我的问题出现的原因是什么呢?心好累

解决方案

已找到问题的原因,原来是

import {Button,Input,DatePicker,Form} from 'antd'

出现了问题,不能这么合起来写,可能会有各种问题,强烈建议不要偷懒,分开来写,最宜!!
ps.下方的代码引用是正确的!!

import   Button  from 'antd/lib/button';
import   Input  from 'antd/lib/input';
import   DatePicker  from 'antd/lib/date-picker';
import   Form  from 'antd/lib/form';

这篇关于node.js - 我用react-redux写的项目,在控制台release -cw的时候显示错误了,但是还是能继续执行(更新了)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆