-
Notifications
You must be signed in to change notification settings - Fork 190
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
Сan't integrate widget #580
Comments
Getting the same issue |
same here |
same |
1 similar comment
same |
You need to transpile module.exports = {
...
transpilePackages: ['@uniswap/widgets']
}; |
Seeing this same issue in a React app using webpack |
Unfortunately after transpile the package still shows the same error |
That's unfortunate. I bumped into the same issue that transpiling |
To make the above comment from @cawabunga explicit, what worked for me was: In module.exports = {
...
transpilePackages: ['@uniswap/widgets', '@uniswap/conedison'],
}; (Using Before applying the fix above, |
@intertwine @cawabunga Thanks, this solved the problem with @uniswap/conedison. But after that another error appeared. |
@Doberman2029 Not sure if it is still relevant. But it looks like you call react hook outside a render function. |
Anyone know the equivalent of this for webpack projects? |
@cawabunga Yeah it's relevant. Problem happen only when widget integrated. So it's problem with hooks inside the package |
Unfortunately, not using nextJS for a project that's using the widget, and the webpack alias did not resolve the issue. So I created a fork branch with the functions of @uniswap/conedison just moved into this repos utils folder, and the issue was resolved. I also ran into the the Since it's not a long term solution to keep a fork updated with conedison functions copied over, to this repo, I looked more into what other repos are using Repos using @uniswap/conedison If there aren't any other repos using the utils in conedison for a purpose other than forks of this widget, can the util functions just be pulled into the utils folder in this repo? Created this tentative PR for the changes: |
If adding both transpiles, get the following
|
I have forked this package published it under the name I hope it helps https://github.com/NFTEarth/uniswap-widgets |
This is the only thing that worked for me, thanks! |
For those here using nextjs v13 and pulling their hairs.
This was resolved by adding this to my nest config:
The resolve option allows you to specify replacements for built-in Node.js modules that are not available or do not work in the browser environment. This is necessary because the fs module is not available in the browser enviroment. So anything in uniswap that tries to import the fs module will receive an empty module instead. After that the only way to get the widget to render is to disable SSR for the it. You can load it like this:
|
@compojoom i am using next.js 14. I followed the instrunctions you gave but i'm getting the following error
|
Has anyone found a way to fix this? |
any ideas for this issue? (next 14 without ts) |
That fixed it for me |
How can I fix it? My part of {
"dependencies": {
"@headlessui/react": "^1.7.19",
"@headlessui/tailwindcss": "^0.2.0",
"@uniswap/sdk-core": "^4.2.1",
"@uniswap/v2-sdk": "^4.3.0",
"@uniswap/v3-sdk": "^3.11.0",
"@uniswap/widgets": "^2.59.0",
"@web3-react/core": "^8.2.3",
"next": "14.2.2",
"react": "^18",
"react-dom": "^18",
"react-redux": "^8.1.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.2",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
|
when you open for me the new url works
|
Good day!
So I have tried to follow the instructions and created webpack.config.js like that:
In root directory of my project, but nothing helped. Anyone faced with this issue before? What actually helped is this case? |
So you can scroll to the reply by Investor in this link - Follow all the instructions and you would be ahead. It worked for me and my app works fine now. |
Thanks for sharing this. I couldn't have thought of this solution. Now my widget works. |
It's so bad that every official example of Uniswap, every project, and even the officially maintained wallet components are reporting errors. It's hard to believe what kind of team they are |
Bug Description
Dependency (modules) error when using widget
Steps to Reproduce
Expected Behavior
The widget must be on the page, the project must be compiled successfully
Additional Context
Problem with module \node_modules@uniswap\conedison\dist\provider\signing
The text was updated successfully, but these errors were encountered: