TypeError:无法读取未定义webpack的属性'0' [英] TypeError: Cannot read property '0' of undefined Webpack

查看:24
本文介绍了TypeError:无法读取未定义webpack的属性'0'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建ant-design的演示,我已经安装了Ant-Design,现在当我点击

npm start

我收到此错误

           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

我尝试了几种解决方案,但由于我是ant-design的新手,所以很难理解这个概念。有没有人可以帮我解决这个问题?

提前感谢:)

推荐答案

通过以下安装解决了此问题

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

参考:Webpack Issue#2764

这篇关于TypeError:无法读取未定义webpack的属性&#39;0&#39;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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