-
I have a React, TypeScript, and Vite project. All the images are currently in the dist folder. Should they be in the dist/assets folder? Everything works when I run 'vite build' and then 'vite preview'. The problem is when I test it in production. In production, I get 404 errors when first loading. It's looking for files in the asset folder that are there. The site loads if I add base: '' to the vite.config file. The problem then is that the images won't load. When looking at the image paths in the browser's dev tools, it shows 'src="/imageName.jpg". So the images should be loading, correct? Finally, the entire project is in a folder titled new. So I can load it with myurl.com/new. This is so I can test it before moving it to the root level. Why are my images not loading? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Never Mind. React Router is redirecting the browser outside the new folder. |
Beta Was this translation helpful? Give feedback.
Never Mind. React Router is redirecting the browser outside the new folder.