Next.js + RainbowKit/Wagmi app with optional Unicorn wallet auto-connect.
- Node.js 20+ (NVM recommended)
- Environment variables set in
.env.local:
NEXT_PUBLIC_WC_PROJECT_ID=...
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=...
NEXT_PUBLIC_THIRDWEB_FACTORY_ADDRESS=0x...
NEXT_PUBLIC_CHAIN="polygon" Because @unicorn.eth/autoconnect currently declares peer dependencies for React 18 while this app uses React 19, you may need to bypass peer resolution. Two options:
npm install --legacy-peer-depsIf you already ran install and hit ERESOLVE, re-run with the flag:
npm ci --legacy-peer-deps || npm install --legacy-peer-depsYarn ignores peer dependency failures by default. Simply run:
yarn installIf you prefer strict resolution with Yarn Berry/Modern, configure packageExtensions accordingly or fall back to npm install --legacy-peer-deps.
npm run dev
# or
yarn devApp runs at http://localhost:3000.
npm run build- Unicorn is required by product requirements.
- The package exports runtime APIs compatible with React 19, but its peer deps target React 18, hence the install flag above.
- We add a small local type augmentation at
src/types/unicorn-autoconnect.d.tsto exposeunicornConnectorin TypeScript.
- Next.js 15
- React 19
- RainbowKit / Wagmi v2
- Prisma
- Chakra UI
- Install errors (ERESOLVE): use
npm install --legacy-peer-deps. - Types complaining about
unicornConnector: ensuresrc/types/unicorn-autoconnect.d.tsexists andtsconfig.jsonincludes**/*.d.ts(default here).