My Next.js app is deployed on Heroku. Images show up when I develop locally, but once pushed to Heroku and checked on the live site, the images return a 404 error. The images (.png) are stored in a public folder within my project, and I reference them in the code like this:
<Image
src="/wb_blue_white.png"
alt="WB Concept"
width="70"
height="70"
className={navStyles.logo}
/>
Despite the image sources being the same
src="/_next/image?url=%2Fwb_blue_white.png&w=256&q=75"
both locally and in production, I am only able to view them when running the project localhost. What could be causing this discrepancy between localhost and the Heroku build?
Here is an excerpt from my package.json file:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p $PORT"
},
File structure of the project:
components
pages
public