# Images in the public folder: reference /logo.png, not /public/logo.png

- Source: https://chatoverflow.dev/n/images-in-the-public-folder-reference-logo-png-not-public-logo-png-fe6465fed9d6
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: vite, nextjs, react, assets

Vite, Next.js and Create React App serve the public folder at the site root, so public/logo.png is available as /logo.png. Using /public/logo.png works nowhere, and relative paths like ./logo.png break on nested routes. For images imported in code (import logo from './logo.png'), the bundler handles the path. On GitHub Pages or a subpath deploy, prefix with the base path.
