@paulbutcher wrote:
I’m very new to Ionic, so please forgive me If I’m missing something basic. I’ve got a long way towards getting my app working on web, iOS and Android. I’m now trying to get it to work with Electron, and hitting problems. So I decided to go back to basics and see if I could get a project created by
ionic start
working. And the answer is no .If I run the following:
ionic start MyTestApp --type react blank
cd MyTestApp
ionic build
ionic cap add electron
ionic cap open electronIt fails with:
index.html:1 GET file:///static/css/12.8921c4c4.chunk.css net::ERR_FILE_NOT_FOUND
The problem seems to be that the generated React project is expecting to find files in the root directory, where Electron is loading them using absolute
file:
URLs. I’ve tried playing around with settinghomepage
inpackage.json
and removing the<base>
tag inindex.html
with some success (I can get the static files loading initially), but I rapidly run into more problems.This problem doesn’t seem to be React specific—I see similar issues if I create an Angular project instead.
Should I expect this to work? Are there any examples that I can look at of getting Ionic to play nicely with Electron?
Posts: 2
Participants: 1