Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Widget doesn't work at all with React #634

@joshschcom

Description

@joshschcom

Bug Description & Stps to reprouce
Done everything to insert the widget in the docs on a plain React App.
When you then start the React App you get the following error:

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

After trying multiple steps to somehow get it working, after installing craco and adding a webpack config:

const webpack = require("webpack");

module.exports = {
  webpack: {
    configure: (webpackConfig) => {
      webpackConfig.module.rules.forEach((rule) => {
        if (rule.use) {
          rule.use.forEach((loader) => {
            if (loader.loader === "source-map-loader") {
              loader.exclude = [
                /node_modules\/jsbi/,
                /node_modules\/node-vibrant/,
              ];
            }
          });
        }
      });
      webpackConfig.resolve.fallback = {
        assert: require.resolve("assert/"),
        http: require.resolve("stream-http"),
        https: require.resolve("https-browserify"),
        path: require.resolve("path-browserify"),
        fs: false,
      };
      webpackConfig.plugins.push(
        new webpack.ProvidePlugin({
          process: "process/browser",
        })
      );
      return webpackConfig;
    },
  },
};

We still get errors and the localhost shows us that nothing can be fetched for example the Tokenlist

Screenshot 2024-05-19 164921

Additional Context
It also doesnt work with next with very similar errors, and downgrading doesnt work either

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions