babel-plugin-component icon indicating copy to clipboard operation
babel-plugin-component copied to clipboard

同一个项目中,既包含了全量引入,又包含了按需引入,然后有如下报错,请教下如何解决?

Open mexhfl opened this issue 2 years ago • 1 comments

error in ./src_form/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_form\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first. at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_form/main.js

error in ./src_report/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_report\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first. at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_report/main.js

error in ./src_todo/main.js

Syntax Error: Error: D:\Project\jc_forms_git\src_todo\main.js: [babel-plugin-component] If you are using bothon-demand and importing all, make sure to invoke the importing all first. at Array.map ()

@ multi (webpack)-dev-server/client?http://192.168.1.208:8080/sockjs-node (webpack)/hot/dev-server.js ./src_todo/main.js

mexhfl avatar Jun 08 '22 09:06 mexhfl

按照babel-plugin-component给出的提示,如果既有全局又有按需引入的话,你应该先全局引入,再按需引入。

purer01 avatar Dec 17 '23 07:12 purer01