Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with webpack >= 5 #12

Open
remi-blaise opened this issue May 29, 2023 · 1 comment
Open

Issues with webpack >= 5 #12

remi-blaise opened this issue May 29, 2023 · 1 comment

Comments

@remi-blaise
Copy link

Hello,

There are issues at install for using polyfill in the browser with webpack > 5

image
image

Also installing @coinbase/wallet-sdk which had to be done manually.

Thanks for the work.

Take care,

@remi-blaise
Copy link
Author

fixed it with craco.config.js

const webpack = require('webpack')

module.exports = {
  webpack: {
    plugins: {
      add: [
        // Work around for Buffer is undefined:
        // https://github.com/webpack/changelog-v5/issues/10
        new webpack.ProvidePlugin({
          Buffer: ['buffer', 'Buffer'],
        }),
      ],
    },

    configure: (webpackConfig, { env, paths }) => {
      // eslint-disable-next-line no-param-reassign
      webpackConfig.resolve.fallback = {
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify"),
        "assert": require.resolve("assert"),
        "http": require.resolve("stream-http"),
        "https": require.resolve("https-browserify"),
        "os": require.resolve("os-browserify"),
        "url": require.resolve("url"),
        "buffer": require.resolve("buffer"),
      };
      return webpackConfig;
    },
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant