I'm having a bit of a headache with my rock-paper-scissors project. It works perfectly on my local machine, but when I deploy it on GitHub Pages, the images just won't show up. Has anyone else run into this issue before? If so, any chance you could share how you fixed it? Or, if you're up for it, feel free to copy my repository and take a look yourself. Thanks a bunch!
3 Answers
Sounds to me like your image paths are incorrect. Always good to verify them! Maybe try clearing your cache and refreshing the page too, just to be sure the latest version is loading.
I think the issue might be with your image paths. Are you sure you're using relative paths? If your images aren't displaying on GitHub Pages, they might not be pointing to the right place. Double-check that!
Exactly, relative paths are usually the way to go for deployed projects.
Have you tried using Vite’s new URL() method for your assets? It looks something like this:
```
const icons = {
rock: new URL('../img/stone.png', import.meta.url).href,
paper: new URL('../img/paper.png', import.meta.url).href,
scissors: new URL('../img/scissors.png', import.meta.url).href,
};
```
This might help you get the correct paths for your images when they're deployed!

Yeah, it definitely sounds like that. Make sure to check how your paths are set up.