feat(examples): next-chakra-v3 host reproduction#614
Conversation
Adds a workspace-linked example that mirrors b3tr's stack — Next.js (App Router) + React 18 + Chakra UI v3 + next-themes — driving the kit via the same `useColorMode` / `useToken` patterns the production app uses. Lets us reproduce and debug host integration edge cases (notably the Chakra v3 `useToken` value-vs-var-ref pitfall) against the local kit sources without needing to publish new releases. Run with `yarn dev:next-chakra-v3` (kit watch + example dev on :3010). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThis PR adds a complete next-chakra-v3 example demonstrating Chakra UI v3 semantic token propagation to the VeChain kit with color-mode switching, updates Next.js to ~16.2.3 across existing examples for consistency, and integrates the example into workspace tooling for development. Changesnext-chakra-v3 Example and Dependency Updates
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (5)
examples/next-chakra-v3/src/components/ui/color-mode.tsx (2)
19-19: 💤 Low valueConsider removing the empty interface.
The interface doesn't add any new properties beyond
ThemeProviderProps. While this might be for future extensibility, it currently adds no value.♻️ Simplify by using the base type directly
-export interface ColorModeProviderProps extends ThemeProviderProps {} -export function ColorModeProvider(props: ColorModeProviderProps) { +export function ColorModeProvider(props: ThemeProviderProps) { return ( <ThemeProvider attribute="class" disableTransitionOnChange {...props} /> ); }As per coding guidelines (static analysis): An interface declaring no members is equivalent to its supertype.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` at line 19, Remove the redundant empty interface ColorModeProviderProps that merely extends ThemeProviderProps; instead use ThemeProviderProps directly wherever ColorModeProviderProps is referenced (e.g., props typing for ColorModeProvider or any function/component signatures), or delete the type alias and update imports/usages to refer to ThemeProviderProps to keep typings identical and remove unnecessary indirection.
51-51: 💤 Low valueConsider removing the empty interface.
Similar to line 19, this interface adds no properties beyond what it extends.
♻️ Simplify by inlining the type
-interface ColorModeButtonProps extends Omit<IconButtonProps, 'aria-label'> {} - export const ColorModeButton = React.forwardRef< HTMLButtonElement, - ColorModeButtonProps + Omit<IconButtonProps, 'aria-label'> >(function ColorModeButton(props, ref) {As per coding guidelines (static analysis): An interface declaring no members is equivalent to its supertype.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` at line 51, The empty interface ColorModeButtonProps that extends Omit<IconButtonProps, 'aria-label'> is redundant; remove the interface declaration and replace references to ColorModeButtonProps with the inlined type Omit<IconButtonProps, 'aria-label'> (e.g., update the ColorModeButton component props signature and any usages to use Omit<IconButtonProps, 'aria-label'> directly).examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx (3)
36-37: ⚡ Quick winType assertion may be unsafe.
The
as stringassertion assumessys.token.var()always returns a string, but if the token path is invalid, it might returnundefined. Consider adding validation or using a more defensive type guard.🛡️ Add validation for token variables
const sys = useChakraContext(); - const tokVar = (path: string) => - sys.token.var(`colors.${path}`) as string; + const tokVar = (path: string): string => { + const value = sys.token.var(`colors.${path}`); + if (!value) { + console.warn(`Missing Chakra token: colors.${path}`); + return `var(--fallback-color)`; + } + return value as string; + };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around lines 36 - 37, The helper tokVar currently asserts sys.token.var(`colors.${path}`) as string which can be undefined; update tokVar to check the result of sys.token.var(`colors.${path}`) at runtime and handle non-string/undefined values—either return a safe default, throw a clear error, or narrow the type before returning. Locate tokVar and replace the blind cast with a guard that verifies typeof value === "string" (or uses a provided default/fallback) so callers get a guaranteed string or an explicit failure.
45-48: 💤 Low valueConsider removing the void statement.
The
void useToken;statement is unusual. While the comment explains this is intentional, keeping an unused import just for documentation purposes adds confusion. Consider removing the import and updating the comment to reference the hook name as a string instead.♻️ Remove the unused import
-import { useChakraContext, useToken } from '@chakra-ui/react'; +import { useChakraContext } from '@chakra-ui/react';Update the comment at lines 29-34 to reference
useTokenas text without importing it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around lines 45 - 48, Remove the odd no-op "void useToken;" and the corresponding import of useToken; instead update the comment that currently references useToken by keeping the hook name as plain text (e.g., "useToken") to document the broken path without importing it; ensure any import list and top-of-file imports remove useToken so there are no unused imports or no-op statements left in VechainKitProviderWrapper.tsx and that the comment clearly states the hook name as a string.
73-100: 💤 Low valueHardcoded credentials present in example code.
The file contains hardcoded Privy and WalletConnect credentials with environment variable fallbacks. While this pattern is acceptable for example/demo code to ensure it runs out-of-the-box, consider adding a comment warning developers to replace these with their own credentials in production applications.
📝 Add warning comment
privy={{ + // NOTE: Replace these demo credentials with your own in production appId: process.env.NEXT_PUBLIC_PRIVY_APP_ID || 'cm4wxxujb022fyujl7g0thb21',🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around lines 73 - 100, The example embeds hardcoded Privy and WalletConnect credentials inside the VechainKitProviderWrapper dappKit and privy config blocks (appId, clientId, walletConnectOptions.projectId); add a clear top-line comment immediately above these default fallbacks warning that these are example/demo credentials and must be replaced with real environment-provided values in production, and recommend using only process.env variables (remove or de-emphasize the hardcoded secrets) so developers know to supply NEXT_PUBLIC_PRIVY_APP_ID, NEXT_PUBLIC_PRIVY_CLIENT_ID and NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID for production.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/homepage/package.json`:
- Line 21: The package.json lists "next": "~16.2.3" which requires React 19.2+,
but the file currently pins React to ^18; fix by making the dependencies
compatible: either update the "react" and "react-dom" entries to ^19.2.0 (and
verify any peer changes) when keeping "next" at ~16.2.3, or change "next" to a
15.x release (e.g., ^15.0.0) that supports React 18; update package.json
accordingly and run install/test to confirm no peer conflicts.
In `@examples/next-chakra-v3/README.md`:
- Around line 32-34: Update the README sentence that currently reads "The
example serves on http://localhost:3001." to the correct local URL
"http://localhost:3010." Locate the line in examples/next-chakra-v3/README.md
containing that sentence and replace the port number 3001 with 3010 so the
documented local URL matches the actual dev server.
- Around line 16-19: The README's description of VechainKitProviderWrapper is
inaccurate: update the sentence that references useToken('colors', [...]) to
state that Chakra v3's useToken returns resolved token values (actual color
strings like "#ffffff" or "rgb(...)"), not CSS variable references such as
var(--vbd-colors-bg-primary); keep the rest of the note about piping those
values into the kit's theme prop and passing darkMode={colorMode === 'dark'}
unchanged and reference VechainKitProviderWrapper and useToken so the intent and
repro are clear.
In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx`:
- Around line 36-38: The toggleColorMode currently inspects resolvedTheme only,
ignoring the computed colorMode (forcedTheme || resolvedTheme) and causing
inconsistent behavior when a theme is forced; update the toggleColorMode
function to use the computed colorMode variable (the one derived from
forcedTheme || resolvedTheme) to decide the new theme, e.g., compute newTheme =
colorMode === 'dark' ? 'light' : 'dark' and call setTheme(newTheme) so toggling
respects forcedTheme when present.
In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx`:
- Around line 42-43: secondaryHover is using an incorrect semantic token path so
tokVar('card.hover') returns undefined; update the reference in
VechainKitProviderWrapper where secondaryDefault and secondaryHover are set so
that secondaryHover uses the correct token path tokVar('card.subtle.hover')
(keep secondaryDefault as tokVar('card.subtle')) to match the theme's
card.subtle.hover token.
In `@examples/playground/package.json`:
- Line 21: The Next.js dependency "next": "~16.2.3" requires Node.js >=20.9.0
but our project uses Node 18; update project configuration to require Node
20.9.0+ by adding or updating the package.json "engines" field to "node":
">=20.9.0" (or add an .nvmrc with 20.9.0 or later) and ensure CI/deployment
configs (e.g., any Dockerfile, GitHub Actions runners, or build images) are set
to use Node 20.9.0+ so builds and dev environments match the requirement.
---
Nitpick comments:
In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx`:
- Line 19: Remove the redundant empty interface ColorModeProviderProps that
merely extends ThemeProviderProps; instead use ThemeProviderProps directly
wherever ColorModeProviderProps is referenced (e.g., props typing for
ColorModeProvider or any function/component signatures), or delete the type
alias and update imports/usages to refer to ThemeProviderProps to keep typings
identical and remove unnecessary indirection.
- Line 51: The empty interface ColorModeButtonProps that extends
Omit<IconButtonProps, 'aria-label'> is redundant; remove the interface
declaration and replace references to ColorModeButtonProps with the inlined type
Omit<IconButtonProps, 'aria-label'> (e.g., update the ColorModeButton component
props signature and any usages to use Omit<IconButtonProps, 'aria-label'>
directly).
In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx`:
- Around line 36-37: The helper tokVar currently asserts
sys.token.var(`colors.${path}`) as string which can be undefined; update tokVar
to check the result of sys.token.var(`colors.${path}`) at runtime and handle
non-string/undefined values—either return a safe default, throw a clear error,
or narrow the type before returning. Locate tokVar and replace the blind cast
with a guard that verifies typeof value === "string" (or uses a provided
default/fallback) so callers get a guaranteed string or an explicit failure.
- Around line 45-48: Remove the odd no-op "void useToken;" and the corresponding
import of useToken; instead update the comment that currently references
useToken by keeping the hook name as plain text (e.g., "useToken") to document
the broken path without importing it; ensure any import list and top-of-file
imports remove useToken so there are no unused imports or no-op statements left
in VechainKitProviderWrapper.tsx and that the comment clearly states the hook
name as a string.
- Around line 73-100: The example embeds hardcoded Privy and WalletConnect
credentials inside the VechainKitProviderWrapper dappKit and privy config blocks
(appId, clientId, walletConnectOptions.projectId); add a clear top-line comment
immediately above these default fallbacks warning that these are example/demo
credentials and must be replaced with real environment-provided values in
production, and recommend using only process.env variables (remove or
de-emphasize the hardcoded secrets) so developers know to supply
NEXT_PUBLIC_PRIVY_APP_ID, NEXT_PUBLIC_PRIVY_CLIENT_ID and
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID for production.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 62192511-e520-4545-a9d8-d6ef6260b736
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (16)
examples/homepage/package.jsonexamples/next-chakra-v3/.gitignoreexamples/next-chakra-v3/README.mdexamples/next-chakra-v3/next.config.jsexamples/next-chakra-v3/package.jsonexamples/next-chakra-v3/src/app/layout.tsxexamples/next-chakra-v3/src/app/page.tsxexamples/next-chakra-v3/src/app/providers.tsxexamples/next-chakra-v3/src/components/ui/color-mode.tsxexamples/next-chakra-v3/src/components/ui/provider.tsxexamples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsxexamples/next-chakra-v3/src/theme/theme.tsexamples/next-chakra-v3/tsconfig.jsonexamples/next-template/package.jsonexamples/playground/package.jsonpackage.json
| "i18next": "^24.2.1", | ||
| "i18next-browser-languagedetector": "^8.0.2", | ||
| "next": ">=15.2.3", | ||
| "next": "~16.2.3", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does Next.js version 16.2.3 exist and what are its requirements?
💡 Result:
Yes, Next.js version 16.2.3 exists. It was released on April 8, 2026 [1][2]. This is a patch release backporting security and bug fixes, including fixes for ISR revalidation errors, HMR issues with manifest.ts, deduplication of output assets, styled-jsx race conditions, and Turbopack stability improvements [1]. The latest version as of May 14, 2026, is 16.2.6 [3][4]. Its requirements are the same as Next.js 16: Node.js 20.9.0 or higher (Node.js 18 no longer supported) [5], TypeScript 5.1.0 or higher [5], and browser support for Chrome 111+, Edge 111+, Firefox 111+, Safari 16.4+ [5]. It requires React 19.2 or compatible [5].
Citations:
- 1: https://github.com/vercel/next.js/releases/tag/v16.2.3
- 2: vercel/next.js@d5f649b
- 3: https://github.com/vercel/next.js/releases/latest
- 4: https://github.com/vercel/next.js/releases/tag/v16.2.6
- 5: https://nextjs.org/docs/app/guides/upgrading/version-16
🏁 Script executed:
#!/bin/bash
# Description: Check npm registry for Next.js 16.2.3 availability
# Check if version 16.2.3 exists on npm
curl -s https://registry.npmjs.org/next | jq '.versions["16.2.3"]' | head -20Repository: vechain/vechain-kit
Length of output: 369
Next.js 16.2.3 requires React 19.2 or compatible, but this example uses React 18.
Next.js 16.2.3 exists and was released April 8, 2026, but it requires React 19.2 or later. The current example specifies React ^18, which will cause incompatibility. Either upgrade React to 19.2+ or downgrade Next.js to a 15.x version compatible with React 18.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/homepage/package.json` at line 21, The package.json lists "next":
"~16.2.3" which requires React 19.2+, but the file currently pins React to ^18;
fix by making the dependencies compatible: either update the "react" and
"react-dom" entries to ^19.2.0 (and verify any peer changes) when keeping "next"
at ~16.2.3, or change "next" to a 15.x release (e.g., ^15.0.0) that supports
React 18; update package.json accordingly and run install/test to confirm no
peer conflicts.
| - A `VechainKitProviderWrapper` that pipes `useToken('colors', [...])` | ||
| results — which Chakra v3 returns as CSS variable references like | ||
| `var(--vbd-colors-bg-primary)` — straight into the kit's `theme` prop and | ||
| passes `darkMode={colorMode === 'dark'}` |
There was a problem hiding this comment.
Correct the token-behavior description to match the repro case.
This text currently describes useToken output as CSS var references, which conflicts with the Chakra v3 pitfall this example is meant to reproduce/document.
📝 Suggested README edit
-- A `VechainKitProviderWrapper` that pipes `useToken('colors', [...])`
- results — which Chakra v3 returns as CSS variable references like
- `var(--vbd-colors-bg-primary)` — straight into the kit's `theme` prop and
- passes `darkMode={colorMode === 'dark'}`
+- A `VechainKitProviderWrapper` that avoids piping resolved `useToken('colors', [...])`
+ snapshots into the kit `theme` prop; instead it uses Chakra token CSS variable
+ references (e.g. via `sys.token.var(...)`) so kit surfaces keep tracking
+ `next-themes` class toggles in real time, while still passing
+ `darkMode={colorMode === 'dark'}`🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/next-chakra-v3/README.md` around lines 16 - 19, The README's
description of VechainKitProviderWrapper is inaccurate: update the sentence that
references useToken('colors', [...]) to state that Chakra v3's useToken returns
resolved token values (actual color strings like "#ffffff" or "rgb(...)"), not
CSS variable references such as var(--vbd-colors-bg-primary); keep the rest of
the note about piping those values into the kit's theme prop and passing
darkMode={colorMode === 'dark'} unchanged and reference
VechainKitProviderWrapper and useToken so the intent and repro are clear.
| The example serves on http://localhost:3001. Click the sun/moon icon to | ||
| toggle `next-themes`; open the connect modal to inspect kit theme | ||
| propagation. |
There was a problem hiding this comment.
Fix the documented local URL.
The README points to http://localhost:3001, but this example runs on port 3010.
📝 Suggested README edit
-The example serves on http://localhost:3001. Click the sun/moon icon to
+The example serves on http://localhost:3010. Click the sun/moon icon to
toggle `next-themes`; open the connect modal to inspect kit theme
propagation.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| The example serves on http://localhost:3001. Click the sun/moon icon to | |
| toggle `next-themes`; open the connect modal to inspect kit theme | |
| propagation. | |
| The example serves on http://localhost:3010. Click the sun/moon icon to | |
| toggle `next-themes`; open the connect modal to inspect kit theme | |
| propagation. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/next-chakra-v3/README.md` around lines 32 - 34, Update the README
sentence that currently reads "The example serves on http://localhost:3001." to
the correct local URL "http://localhost:3010." Locate the line in
examples/next-chakra-v3/README.md containing that sentence and replace the port
number 3001 with 3010 so the documented local URL matches the actual dev server.
| const toggleColorMode = () => { | ||
| setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'); | ||
| }; |
There was a problem hiding this comment.
Potential inconsistency in toggle logic.
Line 35 computes colorMode as forcedTheme || resolvedTheme, but line 37's toggleColorMode only checks resolvedTheme. If a theme is forced, the toggle might not behave as expected since it ignores the forcedTheme value.
🔧 Suggested fix to use computed colorMode
export function useColorMode(): UseColorModeReturn {
const { resolvedTheme, setTheme, forcedTheme } = useTheme();
const colorMode = forcedTheme || resolvedTheme;
const toggleColorMode = () => {
- setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
+ setTheme(colorMode === 'dark' ? 'light' : 'dark');
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const toggleColorMode = () => { | |
| setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'); | |
| }; | |
| export function useColorMode(): UseColorModeReturn { | |
| const { resolvedTheme, setTheme, forcedTheme } = useTheme(); | |
| const colorMode = forcedTheme || resolvedTheme; | |
| const toggleColorMode = () => { | |
| setTheme(colorMode === 'dark' ? 'light' : 'dark'); | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` around lines 36 -
38, The toggleColorMode currently inspects resolvedTheme only, ignoring the
computed colorMode (forcedTheme || resolvedTheme) and causing inconsistent
behavior when a theme is forced; update the toggleColorMode function to use the
computed colorMode variable (the one derived from forcedTheme || resolvedTheme)
to decide the new theme, e.g., compute newTheme = colorMode === 'dark' ? 'light'
: 'dark' and call setTheme(newTheme) so toggling respects forcedTheme when
present.
| const secondaryDefault = tokVar('card.subtle'); | ||
| const secondaryHover = tokVar('card.hover'); |
There was a problem hiding this comment.
Incorrect token path references non-existent semantic token.
Line 43 reads card.hover but the theme defines card.subtle.hover (see theme.ts lines 61-66). This will cause tokVar('card.hover') to return an undefined or invalid CSS variable reference, breaking the secondary button hover state.
🐛 Fix the token path
const primaryHover = tokVar('actions.primary.hover');
- const secondaryDefault = tokVar('card.subtle');
- const secondaryHover = tokVar('card.hover');
+ const secondaryDefault = tokVar('card.subtle');
+ const secondaryHover = tokVar('card.subtle.hover');
const borderSecondary = tokVar('border.secondary');🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around
lines 42 - 43, secondaryHover is using an incorrect semantic token path so
tokVar('card.hover') returns undefined; update the reference in
VechainKitProviderWrapper where secondaryDefault and secondaryHover are set so
that secondaryHover uses the correct token path tokVar('card.subtle.hover')
(keep secondaryDefault as tokVar('card.subtle')) to match the theme's
card.subtle.hover token.
| "i18next": "^24.2.1", | ||
| "i18next-browser-languagedetector": "^8.0.2", | ||
| "next": ">=15.2.3", | ||
| "next": "~16.2.3", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does Next.js version 16.2.3 exist and what are its requirements?
💡 Result:
Yes. Next.js v16.2.3 is an official release (tag v16.2.3, released April 8, 2026) and is described as a backport of security and bug fixes. [1]
Requirements (same as Next.js 16.x):
- Node.js: 20.9.0+ (Node 18 is not supported) [2]
- TypeScript (if used): 5.1.0+ [2]
- Minimum supported browsers: Chrome 111+, Edge 111+, Firefox 111+, Safari 16.4+ [2]
Sources:
[1] (github.com)
[2] (nextjs.org)
Citations:
- 1: https://github.com/vercel/next.js/releases/tag/v16.2.3
- 2: https://nextjs.org/docs/app/guides/upgrading/version-16
🏁 Script executed:
#!/bin/bash
# Description: Check npm registry for Next.js 16.2.3 availability
# Check if version 16.2.3 exists on npm
curl -s https://registry.npmjs.org/next | jq '.versions["16.2.3"]' | head -20Repository: vechain/vechain-kit
Length of output: 369
Verify Node.js compatibility for Next.js 16.2.3.
Next.js v16.2.3 is a valid release (April 8, 2026) and is compatible with React 18. However, it requires Node.js 20.9.0 or later—Node 18 is not supported. Ensure your development and deployment environments are configured with Node.js 20.9.0+.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/playground/package.json` at line 21, The Next.js dependency "next":
"~16.2.3" requires Node.js >=20.9.0 but our project uses Node 18; update project
configuration to require Node 20.9.0+ by adding or updating the package.json
"engines" field to "node": ">=20.9.0" (or add an .nvmrc with 20.9.0 or later)
and ensure CI/deployment configs (e.g., any Dockerfile, GitHub Actions runners,
or build images) are set to use Node 20.9.0+ so builds and dev environments
match the requirement.
|
Size Change: 0 B Total Size: 8.47 MB ℹ️ View Unchanged
|
Summary
Adds
examples/next-chakra-v3/— a workspace-linked example that mirrors b3tr's frontend stack (Next.js App Router + React 18 + Chakra UI v3 + next-themes). Wires the sameuseColorMode/useTokenpatterns that b3tr uses aroundVeChainKitProviderso we can reproduce and debug host-integration edge cases against the local kit sources without needing to publish new releases.Why
Caught a real bug only reproducible against this stack: Chakra v3's
useToken('colors', 'bg.primary')returns the resolved literal value at render time (e.g.#1B1D1F) rather than a CSS variable reference. When that snapshot is piped into the kit'sthemeprop the kit's modal / card / sticky-header surfaces lock to whichever mode Chakra evaluated first and stop tracking next-themes'html.classtoggles. The existing Chakra v2 playground can't surface this becauseuseTokenv2 returns avar(...)reference by default.The publish-test loop made every iteration expensive. With this example linked to the workspace, edits in
packages/vechain-kit/srcflow through to a runningyarn dev:next-chakra-v3instantly, and Playwright probes against http://localhost:3010 can verify computed CSS variables and rendered colors programmatically.Companion docs PRs:
vechain/vechain-kit-docs#…adds a troubleshooting page about theuseTokensnapshot pitfallvechain/vechain-ai-skills#…notes the same gotcha in the kit-theming referenceWhat
examples/next-chakra-v3/— Chakra v3 + next-themes shell with connect / account modal triggers, theme toggle, and a host-rendered comparison card sharing the same semantic tokens piped into the kit'sthemepropdev:next-chakra-v3root script runs the kit'swatch+ the example's dev server in parallel.gitignorecoversnode_modules,.next,.turbo,dist,next-env.d.ts,.env*sys.token.var(...)workaround so future devs don't repeat the mistakeTest plan
yarn install:allfrom root resolves without new conflictsyarn dev:next-chakra-v3boots on http://localhost:3010🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores