mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-10-30 07:54:05 +08:00
Fixes a React runtime error where `useRef` was null due to multiple React instances being bundled. ## Changes Made - **Vite configuration**: Added `resolve.dedupe` for `react` and `react-dom` in `examples/mcp/vite.config.ts` to ensure only one instance of React is used during bundling - **React version constraints**: Changed from exact versions (`19.2.3`) to flexible ranges (`^19.0.0`) in `examples/mcp/package.json` to improve compatibility - **Build entry point**: Added new `build-app-html-entry.ts` file and updated `tsup.config.ts` to include it as a build target - **Package exports**: Added `./build-app-html` export path in `packages/mcp/package.json` - **Minor fixes**: Updated Next.js type reference path in stripe-app example The root cause was React being duplicated in the bundle, causing hooks like `useRef` to fail when components tried to access React's internal state from the wrong instance. The `dedupe` configuration ensures Vite resolves all React imports to the same module instance. Fixes #190
7 lines
247 B
TypeScript
7 lines
247 B
TypeScript
/// <reference types="next" />
|
|
/// <reference types="next/image-types/global" />
|
|
import "./.next/types/routes.d.ts";
|
|
|
|
// NOTE: This file should not be edited
|
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|