Hello. I am asking regarding my files that is not found when deployed. They are 2 mp3 files inside the src folder.
The thing is, when deployment, the file is nowhere to be found:
and in return, I get 404 on browser. I tried different ways to call the file but it’s not the error because the file is not in the deploy file browser. Please help me.
@naenae00123 You’ll need to provide more information.
How are you deploying? Drag & Drop? Git Repository? CLI?
What are you working with? Can you show your files, or a link to a repository?
The most likely issue is that your files simply aren’t in your Publish directory at deployment:
https://docs.netlify.com/build/configure-builds/overview/#definitions
As it says in the note box in the documentation:
Only files in the publish directory are deployed
Files and assets located outside of the publish directory won’t be included in site deploys.
@naenae00123 Your issue, and the fix, are explained in this thread:
@ayush1 You are using Vite, so your issue is the same as many others using Vite.
You haven’t read or understood the applicable documentation for Vite.
Vite isn’t magic and it won’t work with whatever random project structure you throw at it.
You should read the Vite Static Asset Handling Documentation , in particular the section concerning the Public Directory .
Note: Anyone else encountering this thread that is using Vite and has an issue with images, favicons, or _redirects files (or other s…
2 Likes
Thank you. I haven’t read the documentation and moving the assets to public folder if it must retain the same exact file name without hashing is the answer. Thank you so much! I wasted a lot of time here. Lmao.
1 Like