Electron Help: Files not found

Works fine here in a standard implementation and always has done. Electron can not run SSI. If you are including the links in the header, footer, etc, in an SSI fashion it will fail. Are they in the page itself or in an includes page?

Simple thing to do.

Rename your current index.html file to index_offline.html. Create a new index.html file. Add a component to it, or Framework, or leave it to default to your Project settings. Build and test, see if you have the same issue.

Lets go back to basics and get a basic page loading.

It can be frustrating at first but you can’t ignore the process or the restrictions of Electron. It is not a webserver and can not serve like a webserver. It is an application. It requires a source for data (a second Project for the API). Design connects to API and serves the data. They can not be as one in the same Project. Sorry if you have this set-up in place (two Projects) and am repeating something you already know and have implemented. It can not run SSI or PHP, that we have already established. All links to relative files and libraries (CSS and JS) need to be called from within the page itself (CDN or local). You may need to enable CORS for some remote/hosted content.

And I finally figured it out!

The cause?

<base href="/">

Wappler forcefully adds this to the PHP project, so seeing it just felt normal. I must have looked through every single line of the head tag (all 40 of them) at least 10 times but skimmed over this since I thought it was normal, but it turns out this line just breaks the paths in Electron (Though strangely, it didn’t break the maps component or any components manually added, hence leading to even more confusion). That was a very frustrating couple of hours but at least I know what the problem was now and hopefully, this thread will help someone else if they run into this problem.

And yes, I’m aware of the restrictions of Electron. I already have a fully working site in a separate project which the electron app will work with.

2 Likes

Sometimes it is so simple it escapes our attention. I myself am usually the one who realises my own mistakes are the issue, and not Wappler!

:slight_smile:

Am happy you are up and running. Please remember to leave a Post in the Praise section when you are happy with your experience, explain how simple it is to build an Electron Application. It means a lot to the team!