electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.35k stars 497 forks source link

latest built-in templates typescript error TS2689 #1438

Closed handrianmhel closed 4 years ago

handrianmhel commented 4 years ago

Preflight Checklist

Issue Details

Expected Behavior

boilerplate script npm run start (tsc && electron-forge start) produces error

Actual Behavior

node_modules/electron/electron.d.ts:1655:31 - error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implement s'? 1655 class BrowserWindow extends NodeJS.EventEmitter {

node_modules/electron/electron.d.ts:3013:31 - error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implement s'? 3013 class ClientRequest extends NodeJS.EventEmitter {

node_modules/electron/electron.d.ts:345....

To Reproduce

electron-forge init app-name --template=typescript npm run start

Package Versions:

As per built-in templates here https://www.electronforge.io/templates/typescript-template

Screenshots

https://i.imgur.com/RoCQ0qU.png

Additional Information

Tried to search here that has same issue as this but I'm unable to see or i can't seem to understand it as a direct relation to this concern i got. Total newbie here and has been school project told to try this out as it was said to be stable (condition on the project is not to use react or other known frameworks but simple bootstrap oriented pages and use of some electron modals). But tried workout like installing @types/node on devDependencies but to no avail.

EDIT: tried installing @types/node version 12.12.6 on devDependencies then npm run start, it works, tried to uninstall it and then npm run start, it still works even without dependencies, i even deleted the produced dist folder and tried running again and it now works. Though i don't know if this continues to work after progressing to development. its quite weird so i guess contributors or other can look into this, i have no exact idea how this works.

malept commented 4 years ago

This error is not specific to Electron Forge, see https://github.com/electron/electron/issues/21612