MauriceConrad / Photon

Clone native desktop UI's like cocoa and develop native feeling applications using web technologies
https://mauriceconrad.github.io/Photon/
MIT License
409 stars 38 forks source link

Styles aren't loaded #27

Open josephbuchma opened 6 years ago

josephbuchma commented 6 years ago

Having a bunch of errors like this:

GET file:///home/joseph/projects/SWS/vidplan/app/dist/PhotonOriginal/styles/cocoa.css net::ERR_FILE_NOT_FOUND

Manual juggling with stylesheets is not mentioned in README, so I guess something went wrong way ?

MauriceConrad commented 6 years ago

Okay I have an idea. You are trying to use the browserified version, right?

In this case you have to define the base directory for loading the photon components relative from ‘/dist’

You can do this,

josephbuchma commented 6 years ago

@MauriceConrad no, I'm trying to use not browserified version. I have a project based on this boilerplate for electron.

iafelix commented 6 years ago

I am facing the same issue and the problem is the directory "fonts" does not exists under the path "../app/dist/PhotonOriginal/" As a workaround till the bug is fixed this is what I've done: 1) Download the photonkit https://github.com/connors/photon/releases/download/v0.1.2-alpha/photon-0.1.2-dist.zip 2) Extract the zip file then copy the fonts folder to the app folder "../app/dist/PhotonOriginal/"

Hopefully you fixed it soon, it's a real quick fix indeed

MauriceConrad commented 6 years ago

@iafelix First of all, this is a completely different issue because @josephbuchma faces problems with the general requirement of Photon but you are trying to load original font file I originally did not wanted to contain. But now, I did it. For me personally, Photon's original idea of font based icons is a dirty solution but you had a point: It is not very complex to include the original fonts.

You have to keep in mind that my version of Photon is based on the original framework but does provide a completely different API. I recommend to use SVG based icons instead of font based ones ;-)

MauriceConrad commented 6 years ago

@josephbuchma Okay sorry for answering so late.

I do not hie any idea what exactly is not working in your environment but hopefully, I have a solution.

Detailed

Photon loads each component directly from a dist/ folder that is, in default, relative to the photon.js file. The required module tries to get this path automatically using __dirname. I do not know, what is wrong with your folder structure or environment but all in all, your error means that the dist/ folder, your instance is using, does not exist.

Solution

Set Photon.__baseDir manually to the /dist directory you contain all the components (Just use Photons default /dist).

Can you give me some feedback about your troubleshooting?

tolawho commented 5 years ago

@MauriceConrad please fix this issue. I have same issue image

mrdotkg commented 5 years ago

Same issue here.