Problem
The husky pre-commit hook runs a full-monorepo turbo typecheck. It currently fails on a pre-existing type error in @karakeep/browser-extension, which blocks every commit in the repo regardless of what the commit touches. Contributors currently have to bypass it with git commit --no-verify (both PRs #9 and #10 were committed that way).
Error
A duplicate-vite type mismatch in apps/browser-extension: the copy of vite bundled under @vitejs/plugin-react-swc/node_modules/vite resolves a different DevEnvironment / ModuleInfo type than the root node_modules/vite (the plugin's rollup.ModuleInfo is missing safeVariableNames), so the two are not assignable.
@karakeep/browser-extension:typecheck: Type '...plugin-react-swc/node_modules/vite...DevEnvironment'
is not assignable to type '...node_modules/vite...DevEnvironment'.
Property 'safeVariableNames' is missing in type
'...plugin-react-swc/node_modules/rollup...ModuleInfo' but required in
type '...node_modules/rollup...ModuleInfo'.
Reproduce
pnpm --filter @karakeep/browser-extension typecheck
Fix options
- Dedupe vite — add a pnpm
overrides entry so @vitejs/plugin-react-swc resolves the root vite instead of nesting its own copy.
- Bump
@vitejs/plugin-react-swc to a version whose peer vite matches the root version.
- Scope the hook — have the pre-commit hook typecheck only changed packages (
turbo run typecheck --filter=...[HEAD]) instead of the whole monorepo, so an unrelated broken package can't block every commit.
Option 3 is the most resilient regardless of the underlying type error; 1 or 2 fix the actual mismatch. Ideally do both. Verify pnpm typecheck passes repo-wide afterward.
Impact
Low severity but high friction — silently trains contributors to --no-verify, which defeats the hook entirely.
🤖 Posted on behalf of @joestump by Claude.
Problem
The husky
pre-commithook runs a full-monorepoturbo typecheck. It currently fails on a pre-existing type error in@karakeep/browser-extension, which blocks every commit in the repo regardless of what the commit touches. Contributors currently have to bypass it withgit commit --no-verify(both PRs #9 and #10 were committed that way).Error
A duplicate-
vitetype mismatch inapps/browser-extension: the copy ofvitebundled under@vitejs/plugin-react-swc/node_modules/viteresolves a differentDevEnvironment/ModuleInfotype than the rootnode_modules/vite(the plugin'srollup.ModuleInfois missingsafeVariableNames), so the two are not assignable.Reproduce
Fix options
overridesentry so@vitejs/plugin-react-swcresolves the rootviteinstead of nesting its own copy.@vitejs/plugin-react-swcto a version whose peervitematches the root version.turbo run typecheck --filter=...[HEAD]) instead of the whole monorepo, so an unrelated broken package can't block every commit.Option 3 is the most resilient regardless of the underlying type error; 1 or 2 fix the actual mismatch. Ideally do both. Verify
pnpm typecheckpasses repo-wide afterward.Impact
Low severity but high friction — silently trains contributors to
--no-verify, which defeats the hook entirely.🤖 Posted on behalf of
@joestumpby Claude.