Next.js Discord

Discord Forum

Images not found on Vercel deployment

Unanswered
Evening Grosbeak posted this in #help-forum
Open in Discord
Evening GrosbeakOP
Hello,
I am trying to deploy an app on vercel and a get an error for a svg file can anyone suggest any possible fixes
All media files in /public/media/*/** folder

19 Replies

Does the error happen locally? If yes, fix it. If no, most likely you get casing wrong https://nextjs-discord-common-questions.joulev.dev/module-not-found-error-on-deployment-but-build-works-fine-locally
Evening GrosbeakOP
Where should i keep my Video/images in the project?
If i keep them in /public and try npm run dev it gives me an error. Any suggestions?
Like a file named chirocare.svg is in /public/media/icons/chirocare.svg
I Import it as
import chiro from "./media/icons/chirocare.svg";
@Evening Grosbeak I Import it as import chiro from "./media/icons/chirocare.svg";
The import statement is relative to the file, so it should be
import chiro from “@/public/media/icons/test.svg”
Evening GrosbeakOP
i am getting an error if i use this
I have media in /public and /src/app/media and /src/app/VideoDown.js (file using images)
Evening GrosbeakOP
how to do that?
If you don’t you have to do relative path like
import chiro from “../../../../public/media/icons/test.svg”
Evening GrosbeakOP
this is already setup
needed to add @/app/media/icons/chirocare.svg
Evening GrosbeakOP
Really, really, appreciated all the help @joulev. Can't begin to tell you how helpful you have been.
@Evening Grosbeak Click to see attachment
this works for stuff inside the src folder but not the public folder
well yeah you should just put the file inside the app folder and import it that way