megahertz / electron-log

Simple logging module Electron/Node.js/NW.js application. No dependencies. No complicated configuration.
MIT License
1.3k stars 127 forks source link

`preload.ts` does not have `window.log` property referenced in `node-integration.md` #316

Closed ScubaDrew closed 2 years ago

ScubaDrew commented 2 years ago

I'm following the node-integration.md docs which show:

preload.js:

const log = require('electron-log');

window.log = log.functions;

But when I do this I get:

electron/preload.ts(9,8): error TS2339: Property 'log' does not exist on type 'Window & typeof globalThis'.
megahertz commented 2 years ago

The definition should be declared in app code, since the window.log is defined there, not in the library.