pact-lang-api icon indicating copy to clipboard operation
pact-lang-api copied to clipboard

Webpack v5 removed polyfils for core modules

Open raduciobanu22 opened this issue 3 years ago • 0 comments

Issue description:

In the most recent version webpack removed polyfills for core modules which now need to be manually configured. create-react-app uses webpack v5 and developers building a Dapp using it will see their build failing if pact-lang-api is used as a dependency.

Solution:

  1. Eject the create-react-app config or use react-app-rewired
  2. Install missing deps (https-browserify, stream-http, buffer)
  3. Adjust the webpack config file
....
fallback: {
     https: require.resolve("https-browserify"),
     http: require.resolve("stream-http"),
     buffer: require.resolve("buffer")
},

raduciobanu22 avatar Apr 11 '22 01:04 raduciobanu22