Next.js Discord

Discord Forum

Tailwind CSS Background-image can't display even after I putt the jpg file into /public dir

Answered
Chartreux posted this in #help-forum
Open in Discord
ChartreuxOP
.bg-cuteCat {
    background-image: url('/cuteCat.jpg');
}

this is the inlay hints after I set up the configuration , but the next.js can't read the file , but also it does not pop up an error
PS C:\Users\Shiha\Desktop\talpx\public> ls


    Directory: C:\Users\Shiha\Desktop\talpx\public


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/18/2023  10:32 PM         811464 cuteCat.jpg
-a----        10/10/2023   3:15 PM           1375 next.svg
-a----        10/10/2023   3:15 PM            629 vercel.svg
Answered by joulev
ah yes that's exactly the problem. you can use a matcher/middleware if conditionals to exclude requests that end with jpg
View full answer

4 Replies