pete19
pete19

Reputation: 53

Errors using Typescript with Electron 9

trying to use TS with latest Electron 9.0.3. I renamed main.js to main.ts, and adjusted "main" value in package.json to use main.ts.

The main.ts file does get transpiled and works, but it seems Electron 9 does not fully support TS, as I get errors when declaring types, for example:

function my_function(str: string)
{
   // do something
}

will break the app, complaining about the ": string" type declaration...

Is there another setting/config that I'm missing ?

Upvotes: 0

Views: 186

Answers (1)

OJ Kwon
OJ Kwon

Reputation: 4641

Electron never supported run typescript file directly and never will. You have to supply .js file transpiled from typescript to electron instead of pointing typescript file directly.

Upvotes: 2

Related Questions