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.

Error occurred in Nextjs 15  #644

@muhammadfaizan7986

Description

@muhammadfaizan7986
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

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