-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.0.5 fails to compile #110
Comments
Same error, Electron 17.0.1 |
Same error Electron 17.0.1 @electron/remote 2.0.4 builds fine, 2.0.5 does not. Error: Error: node_modules/@electron/remote/index.d.ts:42:41 - error TS2551: Property 'NativeImage' does not exist on type 'typeof CrossProcessExports'. Error: Error: node_modules/@electron/remote/index.d.ts:57:41 - error TS2551: Property 'WebContents' does not exist on type 'typeof CrossProcessExports'. Error: Error: node_modules/@electron/remote/index.d.ts:58:42 - error TS2551: Property 'WebFrameMain' does not exist on type 'typeof CrossProcessExports'. |
FYI - It looks like these types are exported in Electron 17.1.0. It would still be nice to have a more flexible solution, but that's at least workable presuming 17.1.0 doesn't break anything significant. |
Fixes electron#110. Signed-off-by: Anders Kaseorg <[email protected]>
Thanks for the ping. This seems to be a change between Electron 14 and 15. Electron 14 declares declare namespace Electron {
class NativeImage { … }
class WebContents extends NodeEventEmitter { … }
class WebFrameMain extends NodeEventEmitter { … }
const nativeImage: typeof NativeImage;
const webContents: typeof WebContents;
const webFrameMain: typeof WebFrameMain;
}
declare module 'electron' {
export = Electron;
} where the difference between But Electron 15 declares declare namespace Electron {
class NativeImage { … }
class WebContents extends NodeEventEmitter { … }
class WebFrameMain extends NodeEventEmitter { … }
namespace CrossProcessExports {
const nativeImage: typeof NativeImage;
type NativeImage = Electron.NativeImage;
const webContents: typeof WebContents;
type WebContents = Electron.WebContents;
const webFrameMain: typeof WebFrameMain;
type WebFrameMain = Electron.WebFrameMain;
}
}
declare module 'electron' {
export = Electron.CrossProcessExports;
} where I think |
* fix: types for nativeImage, webContents, webFrameMain again Fixes #110. Signed-off-by: Anders Kaseorg <[email protected]> * ci: Remove Electron 11 ShareMenu and webFrameMain are new in Electron 12. Signed-off-by: Anders Kaseorg <[email protected]> * fix: Remove exclusion of index.d.ts from tsconfig This was previously excluded (#48) because of CI failures due to index.d.ts referencing files in dist. Those references were later removed (#58), so we can include it again to have CI verify that index.d.ts type checks. Signed-off-by: Anders Kaseorg <[email protected]>
🎉 This issue has been resolved in version 2.0.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Issue discover using a project that depends on an up-to-date Electron, currently 17.0.1. Three new lines in index.d.ts are the source of the problem:
line 42:
export var nativeImage: typeof Electron.NativeImage;
line 57:
export var webContents: typeof Electron.WebContents;
line 58:
export var webFrameMain: typeof Electron.WebFrameMain;
All three can be fixed by using the type of the exported instances rather than relying on types that aren't directly available outside the Electron package:
export var nativeImage: typeof Electron.nativeImage;
export var webContents: typeof Electron.webContents;
export var webFrameMain: typeof Electron.webFrameMain;
The text was updated successfully, but these errors were encountered: