在Webpack 5中使用StockX API的尝试失败

问题描述

在使用Webpack 5构建项目时,我尝试使用stockx-api进行开发-关于这样的polyfill,我会遇到很多错误

enter image description here

我尝试按照说明进行操作,手动安装了软件包,还使用了 resolve.fallback 错误较少​​,但许多错误不会消失(tls,http2,net等),例如这个:

enter image description here

如果有人在新版本的Webpack中遇到此问题,请提供帮助 https://github.com/neveleneves/WishLoot

解决方法

该错误与WebPack 5无关。此模块未找到:错误:无法在.... 中解析'net'是因为 net 是节点模块,并且在浏览器中不存在。但是此问题已经在此站点上得到了很多解答,因此请点击下面的链接。

Module not found: Error: Can't resolve 'net' in node_modules

GitHub link with explanation why the error occurs and how to solve

GitHub link with more comments and solutions