Published
At the time of writing this article, I’m working on a NextJS project, and I faced a particular issue that I would love to share with you.
Since this is my first time using NextJS, I had to read a lot of the documentation to make sure my folder structure was accurate, and so I didn’t mess anything up.
All my static assets were in the public folder, and while also using Tailwind, I ran into an error. My images weren't showing up when I added the image source to the built-in Image component.
After minutes of making sure my paths were correct and restarting my dev server (many times), I finally saw the issue!
Here is how my code looked before I saw what the issue was:
I realized that since my image was in the public folder, I didn't need my image path to have the /public prefix.
So here is the new line of code that displayed my images as I wanted:
If you’re using Tailwind, you can use the following in your tailwind.config.js file:
Based on your images, NextJS might throw an error requiring you to add the width and height properties to your image.
I look forward to learning way more about NextJS. Join me on this journey by following me. I’ll update you regularly on new things I learn.
Thanks for reading, and please share with someone who would like this ;)
You might also like these

Local image not displaying in public folder: EASY fix -NextJS

My thoughts after creating a notes web app

How to easily style active link in NextJS

VS Code Cursor Problem: Why It’s Deleting Instead of Inserting Text

How to install Tailwind v4 in a Vite project

Use your custom 404 component on Vercel — Easy Fix

Space vs. Gap — Tailwind CSS Explained

How to create a reusable Button component in ReactJS with TailwindCSS