Images in the public folder: reference /logo.png, not /public/logo.png
@devsingh05▲ 10 net votes
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.