Skip to content

vite-typescript template conflict with "allowImportingTsExtensions":true #3499

Open

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.2.0

Electron version

v29.0.0

Operating system

Win10 x64 Pro 22H2 19045.3208

Last known working Electron Forge version

7.2.0

Expected behavior

✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies
✔ Running generateAssets hook
......

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 Object.exports.prepare (C:\Users\XLin0mu\AppData\Roaming\npm\node_modules@electron-forge\cli\node_modules\rechoir\index.js:58:11)
at exports.default (C:\Users\XLin0mu\AppData\Roaming\npm\node_modules@electron-forge\cli\node_modules@electron-forge\core\src\util\forge-config.ts:117:17)
at async Task.task (C:\Users\XLin0mu\AppData\Roaming\npm\node_modules@electron-forge\cli\node_modules@electron-forge\core\src\api\start.ts:63:29)
at async Task.run (C:\Users\XLin0mu\AppData\Roaming\npm\node_modules@electron-forge\cli\node_modules\listr2\dist\index.cjs:978:11)
at async C:\Users\XLin0mu\AppData\Roaming\npm\node_modules@electron-forge\cli\node_modules\p-map\index.js:57:22

Steps to reproduce

  1. Execute command npm init electron-app@latest DLR_SA -- --template=vite-typescript.
  2. Add this item to tsconfig.json:
{
"compilerOptions": {
//...
"allowImportingTsExtensions": true,
"noEmit": true,
//whether add "noEmit" at here won't make any different.
//...
}
  1. Run forge start script. npm run start or electron-forge start, givensame error message exclude the path.

Additional information

Full tsconfig.json file (which one make error):

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "commonjs",
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "noImplicitAny": true,
    "sourceMap": true,
    "baseUrl": ".",
    "outDir": "dist",
    "moduleResolution": "node",
    "resolveJsonModule": true,

    "noEmit": true,
    "allowImportingTsExtensions": true,
  },
  "include": ["src"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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