Closed NoxFly closed 1 year ago
I found that following Ionic start project's order, it is not installing the Typescript version of @capacitor-community/electron, but a single javascript minified file, meaning you can't access all definitions etc..., and with function that's not completly working. As if it was giving you an older version.
To fix this problem, you just have to manually download the package, and it will be up to date. It will replace the entire package with the typescript version, and all definitions (interfaces etc...).
Then, in the capacitor.config.ts
, you have to change the type CapacitorConfig
to CapacitorElectronConfig
(and import it).
I found that following Ionic start project's order, it is not installing the Typescript version of @capacitor-community/electron, but a single javascript minified file, meaning you can't access all definitions etc..., and with function that's not completly working. As if it was giving you an older version.
To fix this problem, you just have to manually download the package, and it will be up to date. It will replace the entire package with the typescript version, and all definitions (interfaces etc...).
Then, in the
capacitor.config.ts
, you have to change the typeCapacitorConfig
toCapacitorElectronConfig
(and import it).
Thanks mate. Was doing my head in!
Now the problem that I face that by only making this change to the Electron version of the capacitor.config file, it gets overwritten by the original capacitor file when performing a build. If I make these modifications to the original file I get presented with the below:
Error: node_modules/@capacitor-community/electron/dist/core/ElectronSplashScreen.d.ts:1:27 - error TS7016: Could not find a declaration file for module 'electron'. '***r/electron/build/src/index.js' implicitly has an 'any' type.
Describe the bug
The
getCapacitorElectronConfig()
inelectron/index.ts
returns an empty object{}
while the file exists and the configuration isn't empty.To Reproduce
@capacitor-community/electron
platform. This creates theelectron/
folder.electron/capacitor.config.ts
, see that's not an emptyconfig
object.electron/src/index.ts
, look where is calledgetCapacitorElectronConfig()
and place aconsole.log()
just below.Expected behavior
Having the real configuration object.
Screenshots
Desktop (please complete the following information):
Additional context
It seems that in
node_modules/@capacitor-community/electron/dist/core/index.js
, in this minified file,getCapacitorElectronConfig
will call theY()
function.I just tried some things on it and I found something.
I just developed it a bit so it's cleaner to show you were it is.
Here is the default minified Y function :
The last line is the bug, and returns an empty object. The minifier puts comma
,
beforee.electron
andZ(g)
.I don't know what's intented here, but removing this last line returns the object well.
Hence, you should check this function. It seems that your code is right but the minifier you use just broke your code here.
It's too bad, because I can't use CapacitorSplashScreen, and much more. Hope you'll fix this as soon as possible.
Another problem is that the CapacitorConfig does not have an
electron
property.