1

I am hitting a brick wall trying to display an image with remix.run.

The documentation on Asset Preloads shows the following:

enter image description here

When I do this I am getting a 404 for the /icons/clipboard.svg. Do I need to add a route to get static assets to route properly?

Another example is the Jokes tutorial. I add an assets folder under app with a file heart.svg. From my jokes.jsx, I add <img src="/assets/heart.svg"/> which 404's, along with "~/assets/heart.svg" or "../assets/heart.svg"

I am thinking there is something glaring me in the face that I am missing here, an additional route, build param, something...

Ben Felda
  • 1,474
  • 10
  • 15
  • Another option is to import them. See my answer [here](https://stackoverflow.com/questions/71015461/how-to-load-svg-components-in-remix-run-application/72928536#72928536). – Jöcker Jul 10 '22 at 12:49

1 Answers1

9

Figured it out. Gotta put the asset folder in the public folder for it to get hit. Moving it out of the app folder into public resolved my issue.

Ben Felda
  • 1,474
  • 10
  • 15
  • 1
    Hey, glad you figured it out yourself If it's completely resolved you could mark your question as solved – Can Rau Feb 12 '22 at 22:58