Update imports in fetch.js to use Webpack 5 compatiable polyfills
Webpack 5 no longer automatically adds polyfills for the following imports in fetch.js
const { createDeflate, createGunzip } = require('zlib');
const { parse } = require('url');
const https = require('https');
const http = require('http');
This makes life very difficult for angular 13+
I think all that is needed is to run:
npm install browserify-zlib
npm install stream-http
npm install https-browserify
npm install url
and then update the imports in fetch.js to:
const { createDeflate, createGunzip } = require('browserify-zlib');
const { parse } = require('url');
const https = require('https-browserify');
const http = require('stream-http');
The suggested solution does not work. Removing fetch entirely, and replacing it with axios does work.
For anyone having issues with webpack 5, zlib, https, http, https-browserify or stream-http, see this fork may be helpful. https://github.com/mgscuteri/node-steamapi-webpack-5/blob/master/README.md
I may update the package to use a build system. This wasn't really built with browser support in mind, though, since the Steam API has CORS. Can you tell me what your use case is exactly or if you're just using some proxy?
Closing as stale. This may have already been resolved by the switch to node-fetch.