How to reference a public icon file in Next.js
Answer in brief
Place a static file in the project's public directory and reference it from the site's public URL space. The word public is a filesystem directory name, so leave it out of the requested URL.
Load a folder thumbnail
For a site served from the domain root, put folder.png in public/icons and use /icons/folder.png in the image. Run a production build and request that URL with the filename's exact case.
Check a filename that only fails after deployment
A development filesystem may tolerate a case mismatch between Folder.png and folder.png. Compare the committed file path with the deployed request byte for byte, including the extension. If renaming only by case, verify the resulting capitalization in the version-control index before rebuilding.
Sources
- [1] public Folder — Next.js, accessed November 23, 2026
Frequently asked questions
What changes under a deployment subpath?
Check your configured base path and the URL the browser requests. A leading slash starts at the origin root.