Skip to content

ReferenceError: nodeCrypto is not defined #397

@AuroraLantean

Description

@AuroraLantean

Describe the bug
NextJs UI crashes after adding Stacks-Connect component

To Reproduce
Steps to reproduce the behavior:

  1. Clone my repo: git clone https://github.com/AuroraLantean/nextjs-shadcn-demo2
  2. Install packages: pnpm install
  3. Run NextJs: pnpm run dev
  4. See error: command line shows no error and it works for half a second. Then UI crashes with error: ReferenceError: nodeCrypto is not defined

Expected behavior
NextJs UI should not crash

Screenshots
Image

Desktop (please complete the following information):

  • OS: Linux Mint 22 Wilma based on Ubuntu 24.04 noble
  • Browser: Google Chrome, Version 131.0.6778.204 (Official Build) (64-bit)

Additional context
I tried https://github.com/hirosystems/stacks.js-starters with the latest NextJs 15.1.2 and React 19.0.0 and React Compiler. It works.

The biggest difference is that the stacks.js-starters repo uses Connect comopnent from @stacks/connect-react to wrap around the <ConnectWallet />. but do I have to use that wrapper? Is there something missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions