Search code examples
webpackpolyfillswebpack-5

Failed attempt at using StockX API in Webpack 5


I am trying to use stockx-api for my development, when building a project with Webpack 5 - I get a lot of errors about polyfills like this:

enter image description here

I tried to follow the instructions, installed packages manually, and also used resolve.fallback, there are fewer errors, but many of them do not disappear (tls, http2, net and more) like this:

enter image description here

Please help if anyone faced this problem in the new version of Webpack https://github.com/neveleneves/WishLoot


Solution

  • That error has nothing todo anymore with WebPack 5. This Module not found: error: Can't resolve 'net' in .... is because net is a node module and doesn't exist in the browser. But this issue is already answered many times here on the site so follow the links below.

    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