Next.js Discord

Discord Forum

Issues with public folder content on server

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
Before getting to the actual question, I want to admit that I'm very much still learning here. I know that I have plenty of things that aren't ideal or optimized or whatever, right now I'm just going for functional. Learning is a process!

So my current issue. My project is working when run locally (both with next dev and next build && next start), but when run on an actual server neither serves content from the public directory. Initially I thought it was an issue with images post-build since that seems a common issue, but running dev on the server results in the same issue. Any thoughts?
Answered by Sun bear
Never mind, I'm an idiot
View full answer

3 Replies

Sun bearOP
Further details: any resource loaded from the public folder is returning "The requested resource isn't valid for x received null", and I have setup remotePatterns in my config
Sun bearOP
Unlike many others who have reported similar issues, the issue persists whether I use the next Image component or an HTML img tag. Additionally, accessing any file in that folder directly returns "The file cannot be displayed because it contains errors"
Sun bearOP
Never mind, I'm an idiot
Answer