Skip to content

[React] Incompatible with Next.js and server side rendering #246

@murar8

Description

@murar8

Using the library with an SSR framework results in a build error: ReferenceError: self is not defined
I believe the error comes from the connex library which requires a reference to the global window instance on import. Maybe the issue should be moved to the connex package at your discretion.

Steps to reproduce

  • Create a new Next.js project
  • Install @vechain/dapp-kit-react
  • Import any item from the package (you do not need to run any code, just importing is enough to break it)
  • Run either npm run build or npm run dev

Example

https://codesandbox.io/p/devbox/dapp-kit-nextjs-99tmxr

cc @GianBarGian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions