Pre-flight checklist
Electron Forge version
7.4.0
Electron version
30.0.8
Operating system
Windows 11
Last known working Electron Forge version
No response
Expected behavior
No error
Actual behavior
✔ Checking your system
✔ Locating application
✖ Loading configuration
› Unable to use specified module loaders for ".ts".
◼ Preparing native dependencies
◼ Running generateAssets hook
An unhandled rejection has occurred inside Forge:
Error: Unable to use specified module loaders for ".ts".
at exports.prepare (C:\workspace\AppData\Local\Yarn\Berry\cache\rechoir-npm-0.8.0-fb660b3bc8-10c0.zip\node_modules\rechoir\index.js:58:11)
at exports.default (C:\workspace\AppData\Local\Yarn\Berry\cache\@electron-forge-core-npm-7.4.0-4c33fc0cff-10c0.zip\node_modules\@electron-forge\core\dist\util\forge-config.js:123:25)
at async C:\workspace\AppData\Local\Yarn\Berry\cache\@electron-forge-core-npm-7.4.0-4c33fc0cff-10c0.zip\node_modules\@electron-forge\core\dist\api\start.js:44:35
at async _Task.taskFn (C:\workspace\AppData\Local\Yarn\Berry\cache\@electron-forge-tracer-npm-7.4.0-9f71f99d40-10c0.zip\node_modules\@electron-forge\tracer\dist\index.js:58:20)
at async _Task.run (C:\workspace\AppData\Local\Yarn\Berry\cache\listr2-npm-7.0.2-42ddc71dba-10c0.zip\node_modules\listr2\dist\index.cjs:2063:11)
Steps to reproduce
yarn init -y
yarn set version berry
yarn add -D @electron-forge/cli @electron-forge/plugin-vite electron typescript vite
- Create an empty
forge.config.ts file
yarn electron-forge start
Additional information
If ts-node is installed as dev dependency, the error disappear.
ts-node should be added in package.json (in electron-forge/* and, if it's a transitive peer dependency, in electron) as an optional peer dependency.
Notes
The issue appears only with forge.config.ts and not with forge.config.js.
Related issue #3499
Pre-flight checklist
Electron Forge version
7.4.0
Electron version
30.0.8
Operating system
Windows 11
Last known working Electron Forge version
No response
Expected behavior
No error
Actual behavior
Steps to reproduce
yarn init -yyarn set version berryyarn add -D @electron-forge/cli @electron-forge/plugin-vite electron typescript viteforge.config.tsfileyarn electron-forge startAdditional information
If
ts-nodeis installed as dev dependency, the error disappear.ts-nodeshould be added in package.json (inelectron-forge/*and, if it's a transitive peer dependency, inelectron) as an optional peer dependency.Notes
The issue appears only with
forge.config.tsand not withforge.config.js.Related issue #3499