plexus / chestnut

Application template for Clojure + ClojureScript web apps
Eclipse Public License 1.0
1.32k stars 99 forks source link

Cannot use resources folder in cljs. #253

Open zendevil opened 4 years ago

zendevil commented 4 years ago

I have an app created using Chestnut, and there's an image in the project in the location: resources/public/img.png. I want to use this image in my app, but doing [:img {:src "public/img.png"}] or [:img {:src "./img.png"}] doesn't work. What's the correct src for the image in the resources folder?

featheredtoast commented 4 years ago

Should be accessible by /img.png - the public folder is considered a resources folder, hosted from the root of your app.

zendevil commented 4 years ago

[:img {:src "/img.png"}] doesn't work for me. How can I debug this?

featheredtoast commented 4 years ago

It's working for me, under the default (reagent) setup... What react wrapper are you using?

Can you confirm that you can access the image at localhost:10555/img.png?