TypeError: Cannot read property '0' of undefined Webpack

℡╲_俬逩灬. 提交于 2021-01-05 07:57:14

问题


I'm trying to create a demo of ant-design for that I've installed ant-design and now when I'm hitting

npm start

I got this error

           dora: listened on 8000
📦  1/2 build modules/opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19
                        const dependency = data.dependencies[0];
                                                            ^

TypeError: Cannot read property '0' of undefined
    at /opt/lampp/htdocs/antddemo/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:19:40
    at /opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/webpack/lib/NormalModuleFactory.js:159:3
    at NormalModuleFactory.<anonymous> (/opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/tapable/lib/Tapable.js:82:11)
    at /opt/lampp/htdocs/antddemo/node_modules/npm-install-webpack-plugin-cn/src/plugin.js:24:7
    at /opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:24:19
    at onResolved (/opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/enhanced-resolve/lib/Resolver.js:38:18)
    at innerCallback (/opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/enhanced-resolve/lib/Resolver.js:94:11)
    at loggingCallbackWrapper (/opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/enhanced-resolve/lib/createInnerCallback.js:21:19)
    at /opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/tapable/lib/Tapable.js:134:6
    at /opt/lampp/htdocs/antddemo/node_modules/atool-build/node_modules/enhanced-resolve/lib/ModulesInDirectoriesPlugin.js:54:23

I tried couple of solutions but since I'm new to ant-design it's getting hard to digest the concept. Is there anyone for me to fix this?

Thanks in advance :)


回答1:


Solved this by following installation

install extract-text-webpack-plugin@^2.0.0-beta

REF: Webpack Issue#2764



来源:https://stackoverflow.com/questions/46929386/typeerror-cannot-read-property-0-of-undefined-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!