node.js - 我用react-redux寫的項目,在控制臺release -cw的時候顯示錯誤了,但是還是能繼續執行(更新了)
問題描述
標題不能寫的太長,我重新說明一下我的問題吧:)我用react-redux寫了一個項目,在控制臺發布的時候(-cw監聽了),改著改著,就報錯了
Ω [BABEL] Note: The code generator has deoptimised the styling of '/node_modues/antd/dist/antd.js' as it exceeds the max of '100KB'. [ERROR] Cannot read property ’substr’ of undefined
當時我也沒有管他,就繼續改了,發現頁面也是可以更新,有變化。然后,我把release -cw關了,再重新fis3 release 就錯誤了,不能下去了(Warning不用管)
E:mavenWorkspacelabsforceFrontEndmodules>fis3 release -cw [INFO] Currently running fis3 (E:SoftwareNodejsnode_globalnode_modules.fis3_npminstallfis33.4.17fis3) δ 1736ms δ 0ms Ω ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. [WARNI] Can’t resolve `id` in file [/static/js/require.js], did you miss `npm install id`?.......................................................................................................................................................................................................................................... [WARNI] Can’t resolve `libs/scrollspy` in file [/widget/sidebarmenus/sidebarmenus.js], did you miss `npm install libs`?..... [WARNI] Can’t resolve `xhr2` in file [/node_modules/reqwest/reqwest.js], did you miss `npm install xhr2`?..............................[BABEL] Note: The code generator has deoptimised the styling of '/node_modules/antd/dist/antd.js' as it exceeds the max of '100KB'. [ERROR] Cannot read property ’substr’ of undefined
請問,我的問題出現的原因是什么呢?心好累
問題解答
回答1:已找到問題的原因,原來是
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’;
