- Vercel analytics and speed-insights import react, but don't explicitly depend on it in package.json.
- When using pnpm workspaces, these packages are unable to find react, due to the way pnpm structures dependencies.
- This can be fixed via:
- Using pnpm's
shamefully-hoist
option, which will hoist all dependencies to the root of the workspace. - Specifying react in the pnpm hoist pattern, which will hoist react to the root of the workspace.
- Adding react as a peer dependency of the package
- Using pnpm's