Ant design 項目打包後報錯:"Menu(or Flex) is not defined"
我的項目使用了ant-design 和 ant-design-mobile,在測試環境上沒問題,但是打包發布之後控制臺報錯
Menu is not defined
Flex is not defined
經過一番查找,終於發現問題的原因:
我在代碼中使用Menu 和 Flex 組件的方式是這樣的:
<Menu.Item>xxxx</Menu.Item> <Flex.Item>xxxx</Flex.Item>
打包的時候使用了babel-react-optimize
這個庫包含四個子庫,會對react代碼進行優化,可能是因為其中某個子庫對帶點的標簽如:<Menu.Item>無法識別
解決方案:
const MenuItem = Menu.Item const FlexItem = Flex.Item <MenuItem>xxx</MenuItem> <FlexItem>xxx</FlexItem>
Ant design 項目打包後報錯:"Menu(or Flex) is not defined"
相關推薦
Ant design 項目打包後報錯:"Menu(or Flex) is not defined"
方式 查找 item back TP mob -m flex alt 我的項目使用了ant-design 和 ant-design-mobile,在測試環境上沒問題,但是打包發布之後控制臺報錯 Menu is not definedFlex is not defined
運行.xcworkspace項目後報錯:'React/RCTBundleURLProvider.h’ file not found
gate space 解決 ade not-found ever device 翻譯 刪除 情況:根據https://github.com/rebeccahughes/react-native-device-info添加依賴庫,運行.xcworkspacea項目後報錯 解決
啟動項目,編譯報錯:Consider defining a bean of type 'XXX' in your configuration.
定義 多個 ica 錯誤 stc 就是 dea component 查看 在controller層註入ConfigBean,編譯器報錯: 一開是以為是intellij idea 的告警級別設定的問題,就沒有在意,繼續啟動項目,結果控制臺報錯:Consider defi
Combobox報錯:row[opts.textField].toLowerCase is not a function。
light peer mem div clas erro sea error () 使用easyui框架加載combobox。 html頁面: <span class="search_item"> <span class="item_text">
關於springboot上傳檔案報錯:The temporary upload location ***is not valid
在執行springboot時 ,長時間執行後報錯 the temporary uplaod location *** is not valid 查過資料後發現是centos對‘/temp’下檔案自動清理的原因。 在springboot專案啟動後 系統會在‘/temp’目
docker安裝啟動報錯:Error starting daemon: SELinux is not supported with the overlay2
環境:centos7命令:systemctl start docker systemctl status docker -l報錯:Error starting daemon: SELinux is not supported with the overlay
docker啟動報錯:Error starting daemon: SELinux is not supported with the overlay2 graph driver on this ke
環境:centos7命令:systemctl start docker systemctl status docker -l報錯:Error starting daemon: SELinux is not supported with the overlay
Ubuntu14.04 Anaconda(python3.6)安裝tensorflow (報錯:undefined symbol: zgelsd_; is not a supported wheel等
本來安裝tensorflow是一件無比簡單的事,但在我的電腦上卻裝了一個星期。期間遇到各種麻煩事、各種坑,在此記錄一下,方便大家。報錯包括: undefined symbol: zgelsd_ ImportError: cannot import name
Spring Boot 整合 log4j 實現日誌管理報錯:java.lang.IllegalArgumentException: LoggerFactory is not a Logback
問題: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Log
解決IE報錯:Locale 'chinese' is not well-formed,或RangeError: 區域設置“chinese”的格式不正確的問題
.cn www nbsp false realtime 排查 比較 () 14. 接之前的此博客問題處理:js處理時間時區問題 由於 toLocaleString():據本地時間格式,把 Date 對象轉換為字符串。總是會帶有上午/下午,所以我加了參數:new
TOMCAT啟動時報錯:the CATALINA_HOME environment variable is not defined correctly
步驟一:新增CATALINA_HOME環境變數,變數值同TOMCAT_HOME 步驟二:檢查CATALINA_HOME,JAVA_HOME,TOMCAT_HOME的變數值後邊有沒有分號(;)有的話刪除 此時啟動TOMCAT應該會成功,但在瀏覽器位址列中輸入http://localhost:8
【報錯】項目啟動部署時報錯:java.lang.NoSuchMethodError
autowire .get factory cti local .com org 就是 htm 報錯: =====================================================================================
Vue項目打包後背景圖片路徑錯誤
resolv sse options require xtra pro gpo 解決方案 ron vue項目打包之後背景圖片出錯的解決方案如下: 1,找到 config->index.js裏面,如下修改 默認配置: env: require(‘./prod.
Spring Web 項目Junit測試報錯問題
繼承 text config web項目 cap 正是 obj ssr and 測試對象是Web項目的Service類,參照網上查到的資料,按如下方式執行時報錯, //使用junit4進行單元測試 @RunWith(SpringJUnit4ClassRunner.c
項目移動後報error LNK1123
兩個 sof cvt 操作 es.exe CP mic 嵌入 清單 VS20101.解決方案窗口 項目|項目屬性|配置屬性|清單工具|輸入和輸出|嵌入清單 “是”改為“否”;2.項目|項目屬性|配置屬性|連接器|清單文件|嵌入清單 “是”改為“否”;3.對於64位的操作系統
Spring Boot項目Maven Build報錯的解決方法
running ati 依賴 lur fail compile ring date -c 問題1, [ERROR]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:tes
node項目運行報錯
save not col rac style ins yar fin find Cannot find module ‘webpack/bin/config-optimist‘ 在項目裏面運行npm i webpack-dev-server Cannot find modu
解決升級到Xcode10,react native項目運行報錯問題
failed 錯誤 lib blog ise ould path uil 執行 今天剛升級到Xcode10,就遇到兩個報錯問題 錯誤一:Xcode 10: Build input file double-conversion cannot be found error: B
Vue項目打包後,只能訪問首頁,其他頁面路徑找不到
nbsp sets 參數 nod strong tput set uil env webpack.prod.conf.js 中output添加參數publicPath:‘./‘ 修改webpack.base.conf.js中: publicPath: process.e
vue-cli構建的vue項目打包後css引入的背景圖路徑不對的問題
public 相對 根據 路徑 span 目錄 圖片 pub 正常 使用vue-cli構建vue項目後,再打包遇到一個css引入的背景圖片路徑的問題,就是css代碼中背景圖片是根據相對路徑來寫的,如下圖: 當使用npm run dev命令本地訪問的時候,背景圖片是正常