[X] I have once read some documentation of some project
[X] I agree to behave
[X] I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
7.2.0
Electron version
28.0.0
Operating system
Ubuntu
node 18.15.0
Last known working Electron Forge version
7.2.0 (Same)
Expected behavior
yarn start works
Actual behavior
$ yarn start
yarn run v1.22.10
$ electron-forge start
✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies: 6 / 6 [0.4s]
✔ Running generateAssets hook
⠙ [plugin-vite] Launching dev servers for renderer process code
◼ [plugin-vite] Compiling main process code
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
⠙ [plugin-vite] Compiling main process code
vite v4.5.1 building for development...
watching for file changes...
vite v4.5.1 building for development...
watching for file changes...
build started...
build started...
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
⠹ [plugin-vite] Compiling main process code
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
⠙ [plugin-vite] Compiling main process code
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
⠇ [plugin-vite] Compiling main process code
✔ [plugin-vite] Launching dev servers for renderer process code [0.1s]
✔ [plugin-vite] Compiling main process code [6s]
App threw an error during load
Error: Cannot find module 'core-js/library/web/timers'
Require stack:
- ./.vite/build/main.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1084:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:114728)
at Module._load (node:internal/modules/cjs/loader:929:27)
at l._load (node:electron/js2c/asar_bundle:2:13642)
at Module.require (node:internal/modules/cjs/loader:1150:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/usr/src/mustang/app/electron/.vite/build/main.js:1:274)
at Module._compile (node:internal/modules/cjs/loader:1271:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1326:10)
at Module.load (node:internal/modules/cjs/loader:1126:32)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'core-js/library/web/timers'
Require stack:
- ./.vite/build/main.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1084:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:114728)
at Module._load (node:internal/modules/cjs/loader:929:27)
at l._load (node:electron/js2c/asar_bundle:2:13642)
at Module.require (node:internal/modules/cjs/loader:1150:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/usr/src/mustang/app/electron/.vite/build/main.js:1:274)
at Module._compile (node:internal/modules/cjs/loader:1271:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1326:10)
at Module.load (node:internal/modules/cjs/loader:1126:32)
Steps to reproduce
$ yarn install
$ yarn start
Not reproducible with a minimal app. Only started happening when I included some older library. It may use some commonjs, in a type: module library, which may trigger this. But I'm just guessing, based on the stack.
Additional information
The file node_modules/core-js/library/web/timers.js does not exist in core-js 3.34.0 nor in 3.0.0. It does exist in core.js 2.6.12.
I have node 18.15.0 installed
Fix
Possible fixes:
Depend on core-js 2.6.12. yarn add core-js@2.6.12 removes the error.
Find the culprit line and fix it, but it's called from node.
Pre-flight checklist
Electron Forge version
7.2.0
Electron version
28.0.0
Operating system
Last known working Electron Forge version
7.2.0 (Same)
Expected behavior
Actual behavior
Steps to reproduce
$ yarn install $ yarn start
Not reproducible with a minimal app. Only started happening when I included some older library. It may use some commonjs, in a
type: module
library, which may trigger this. But I'm just guessing, based on the stack.Additional information
The file
node_modules/core-js/library/web/timers.js
does not exist in core-js 3.34.0 nor in 3.0.0. It does exist in core.js 2.6.12.I have node 18.15.0 installed
Fix
Possible fixes:
yarn add core-js@2.6.12
removes the error.