kadena-io / pact-lang-api

BSD 3-Clause "New" or "Revised" License
20 stars 16 forks source link

Webpack v5 removed polyfils for core modules #34

Open raduciobanu22 opened 2 years ago

raduciobanu22 commented 2 years ago

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")
},