Skip to content

fix(frontend): resolve electron installation and vite preload build issues (#2206)#2208

Open
sundaram2021 wants to merge 1 commit into
AgentWrapper:mainfrom
sundaram2021:fix/electron-install-issuse-and-frontend-setup
Open

fix(frontend): resolve electron installation and vite preload build issues (#2206)#2208
sundaram2021 wants to merge 1 commit into
AgentWrapper:mainfrom
sundaram2021:fix/electron-install-issuse-and-frontend-setup

Conversation

@sundaram2021

Copy link
Copy Markdown

Overview

This PR addresses Electron installation and Vite preload build configuration issues (resolves #2206).

It ensures that the project installation completes without build failures from unnecessary postinstall scripts, and modifies the Vite preload configuration to prevent issues relating to code splitting in Electron preload scripts.

Changes

Build & Workspace Configuration

  • pnpm-workspace.yaml:
    • Added core-js: false under allowBuilds to disable unnecessary build scripts during package installation, improving stability and avoiding install failures.
  • vite.preload.config.ts:
    • Configured Rollup build options:
      • Disabled treeshaking (treeshake: false) since it can interfere with Electron-specific APIs in preload environments.
      • Set inlineDynamicImports: true and manualChunks: undefined to force single-chunk outputs, preventing code splitting in preload scripts (which Electron does not natively support).
  • pnpm-lock.yaml:
    • Updated lockfile based on workspace dependency changes.

Routing Setup

  • routeTree.gen.ts:
    • Automatically regenerated route tree files to reflect formatting and routing updates.

Verification Plan

Automated Checks

Run the following scripts from the root directory to verify types and build stability:

# Verify backend packages compile cleanly
cd backend
go test ./...

# Verify frontend types and build structure
cd ../frontend
pnpm run typecheck
pnpm run build

Manual Verification

  1. Run pnpm install in the frontend directory to ensure workspace configuration respects build allowances and installs without errors.
  2. Launch the developer environment using pnpm run dev and verify that the Electron window boots up successfully with all routes rendering properly.

@sundaram2021

Copy link
Copy Markdown
Author

it is important to commit the lock files since it has updated the deps there and incompatible versions are the main reason the development server failing to run on windows. vite.preload.config.ts is automatically updated .
Main change lies in preload config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Electron install failed on initial setup in Windows

1 participant