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

Widget doesn't work at all with React #634

Open
joshschcom opened this issue May 19, 2024 · 4 comments
Open

Widget doesn't work at all with React #634

joshschcom opened this issue May 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@joshschcom
Copy link

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

@joshschcom joshschcom added the bug Something isn't working label May 19, 2024
@IsoBitzzz
Copy link

Just pass it your own token list or download the one in that url and point at it locally. Says how in the docs.

That being said theres a million other issues so have fun with that lol

@joshschcom
Copy link
Author

Just pass it your own token list or download the one in that url and point at it locally. Says how in the docs.

That being said theres a million other issues so have fun with that lol

The Token List is not the issue, yes of course I tried that but its just one of 187 Errors in the console. I highly recommend you create a new react project and try to embed the Widget.

@VivekKadvani
Copy link

Any solution for this widget bug??

@joshschcom
Copy link
Author

Any solution for this widget bug??

No and there will be no support to the Widget from the Uniswap Team and they don't recommend using it as it is discontinued. That was their reply when I send them an Email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants