Skip to content

Bug fix: Windows Rollup Worktree Fix #324

@VooDisss

Description

@VooDisss

Windows Rollup Worktree Fix

Symptom

On Windows, a fresh checkout or Git worktree can fail after:

npm install
npm run dev

with an error like:

Error: Cannot find module @rollup/rollup-win32-x64-msvc

Root Cause

This is not a Git worktree-specific bug.

The actual issue is that npm may fail to materialize Rollup's Windows native optional package during install:

  • rollup
  • @rollup/rollup-win32-x64-msvc

When that package is missing, electron-vite crashes before app startup.

Correct Fix

Declare the Windows Rollup native package explicitly at the workspace root:

"optionalDependencies": {
  "@rollup/rollup-win32-x64-msvc": "^4.52.5"
}

Then update the lockfile:

npm install @rollup/rollup-win32-x64-msvc@4.52.5 --save-optional --package-lock-only

Why This Fix

  • fixes the problem at install time
  • works for normal checkouts and worktrees
  • keeps nested worktrees unchanged
  • avoids runtime repair scripts and other hotfixes

Verification

From a fresh Windows checkout or worktree:

npm install
npm run dev

If the fix is present, node_modules/@rollup/rollup-win32-x64-msvc should exist after install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions