Skip to content

ENOENT error for @stencil/core nested rollup binaries when using @capacitor-community/sqlite with electron-builder on Windows #9305

@vivekmakwanadikus

Description

@vivekmakwanadikus

When building a Windows app with electron-builder, the build fails with an ENOENT error related to a missing Rollup binary for a different platform (rollup-darwin-arm64).
This happens only when the project includes @capacitor-community/sqlite, which depends on @stencil/core.

🧾 Error output

⨯ ENOENT: no such file or directory, scandir 'D:\code\electron-builder-demo\node_modules\@stencil\core\node_modules\@rollup\rollup-darwin-arm64'
failedTask=build
stackTrace=Error: ENOENT: no such file or directory, scandir 'D:\code\electron-builder-demo\node_modules\@stencil\core\node_modules\@rollup\rollup-darwin-arm64'

✅ Expected behavior

The Windows build should complete successfully.
Electron Builder should not attempt to access Rollup binaries for other platforms (e.g. darwin-arm64) when building on Windows.

package.json file

{
  "name": "electron-builder-demo",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "main": "dist-electron/main.js",
  "scripts": {
    "dev:react": "vite",
    "dev:electron": "tsc --project src/electron/tsconfig.json && electron .",
    "build": "tsc -b && vite build",
    "dist:win": "electron-builder --win --x64"
  },
  "dependencies": {
    "@capacitor-community/sqlite": "^7.0.1",
    "@capacitor/android": "^7.4.3",
    "@capacitor/core": "^7.4.3",
    "react": "^19.1.1",
    "react-dom": "^19.1.1",
    "react-router": "^7.9.4",
    "sqlite3": "^5.1.7"
  },
  "devDependencies": {
    "@capacitor/cli": "^7.4.3",
    "@eslint/js": "^9.36.0",
    "@types/node": "^24.6.0",
    "@types/react": "^19.1.16",
    "@types/react-dom": "^19.1.9",
    "@vitejs/plugin-react": "^5.0.4",
    "electron": "^38.2.2",
    "electron-builder": "^26.0.12",
    "eslint": "^9.36.0",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-refresh": "^0.4.22",
    "globals": "^16.4.0",
    "typescript": "~5.9.3",
    "typescript-eslint": "^8.45.0",
    "vite": "^7.1.7"
  }
}
Name Version
OS Windows 11
Node.js v22.17.1
electron-builder ^26.0.12
Electron ^38.2.2
@capacitor-community/sqlite ^7.0.1

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