Skip to content

Error: Cannot find module ´electron-squirrel-startup´ - Vite or Vite with Typescript on execute .exe #3714

Closed

Description

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

^7.5.0

Electron version

32.1.2

Operating system

Windows 11

Last known working Electron Forge version

No response

Expected behavior

Open executable successfully

Actual behavior

This error occurs after using the command: electron-forge make. Once the application is built, when double clicking on the .exe it throws the following error:

image

This ERROR occurs when using vite or vite-typescript templates. If we use webpack or webpack-typescript it works without problems.

Steps to reproduce

  1. Open a terminal and execute: npm init electron-app@latest my-app -- --template=vite or npm init electron-app@latest my-app -- --template=vite-typescript
  2. Execute: npm run make
  3. Execute the .exe created by npm run make
  4. ¡ERROR!

Additional information

Files:
image

Package json:

{
  "name": "my-app",
  "productName": "my-app",
  "version": "1.0.0",
  "description": "My Electron application description",
  "main": ".vite/build/main.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "echo \"No linting configured\""
  },
  "devDependencies": {
    "@electron-forge/cli": "^7.5.0",
    "@electron-forge/maker-deb": "^7.5.0",
    "@electron-forge/maker-rpm": "^7.5.0",
    "@electron-forge/maker-squirrel": "^7.5.0",
    "@electron-forge/maker-zip": "^7.5.0",
    "@electron-forge/plugin-auto-unpack-natives": "^7.5.0",
    "@electron-forge/plugin-fuses": "^7.5.0",
    "@electron-forge/plugin-vite": "^7.5.0",
    "@electron/fuses": "^1.8.0",
    "electron": "32.1.2",
    "vite": "^5.0.12"
  },
  "keywords": [],
  "license": "MIT",
  "dependencies": {
    "electron-squirrel-startup": "^1.0.1"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions