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

Error occurred in Nextjs 15 #644

Open
muhammadfaizan7986 opened this issue Jan 9, 2025 · 0 comments
Open

Error occurred in Nextjs 15 #644

muhammadfaizan7986 opened this issue Jan 9, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@muhammadfaizan7986
Copy link

muhammadfaizan7986 commented Jan 9, 2025

Screenshot 2025-01-09 at 2 58 43 PM

Bug Description
When integrating the Uniswap widget in Next.js 15, the following error occurs:
Module not found: Can't resolve 'fs'
This issue happens because the widget tries to use the Node.js fs module, which is not available in the browser environment. The integration works fine in Next.js 14, but fails in Next.js 15 due to changes in module handling or polyfills.

Versions

next: ^15.1.3
react: ^19.0.0
typescript: ^5.7.2
@uniswap/widgets": 2.18.0,

Expected Behavior
The Uniswap widget should integrate seamlessly in Next.js 15, without any errors related to the fs module. The widget should function as expected in both server-side and client-side environments, similar to its behavior in Next.js 14.

Additional Context
The error occurs specifically when using the Uniswap widget in Next.js 15, where the widget attempts to use the fs (file system) module, which is not available in a browser context. This behavior was not present in Next.js 14, where the integration worked without issues. The difference could be related to changes in how Next.js 15 handles or polyfills Node.js-specific modules for client-side code. This issue may affect other packages relying on server-side Node.js modules in client-side code.

this is code of uniswap wedget

Screenshot 2025-01-09 at 3 03 54 PM
@muhammadfaizan7986 muhammadfaizan7986 added the bug Something isn't working label Jan 9, 2025
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

1 participant