got 3 error when running
Closed this issue · 1 comments
i got 3 error in preloader.ts, i can't give you the error message but i can point out what is the cause.
first thing is you need to remember that preload script in electron is running in renderer process not in main process, but your tsconfig tell otherwise. you need to change the way you access global variable
first error appear here
Line 747 in b490169
this _ready_event won't work because after being compiled it will use the wrong global variable.
if you see the compiled version it would be like below
window.addEventListener("DOMContentLoaded", () => {
setTimeout(() => {
window.dispatchEvent(exports._ready_event);
}, 2);
});
it reference to a wrong global variable exports instead of globalThis, global or window. this is caused by your tsconfig moduleResolution that tells the typescript compiler to assume that it was a node module
the same apply with 2 other error
Line 682 in b490169
Line 713 in b490169
I understand your point, and I'll fix it, but... could you provide the error logs? It would be very helpful~