Skip to content

pre-commit hook blocked by pre-existing @karakeep/browser-extension typecheck failure #11

Description

@joestump

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

  1. Dedupe vite — add a pnpm overrides entry so @vitejs/plugin-react-swc resolves the root vite instead of nesting its own copy.
  2. Bump @vitejs/plugin-react-swc to a version whose peer vite matches the root version.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions