I have a very weird and disgusting problem on Next.js,
Let me explain the steps how weird it is. First, I had these lines across the project.
const userPng = https://www.kindpng.com/picc/m/the_image.png";
Second, the site is ridiculously long to load these weeks, so I decided to switch to loading from the local /public/static/
directory, not the CDN.
Thrid, I deleted all the lines using the URL, replaced them with /static/images/the_image.png
.
This is the notable step, four, I rm -rf
-ed the .next
directory because I knew it is where cached ones stored.
Five, navigating to the localhost
page, opening devtools, the network tab, pressing shift-F5 to reload the page, waiting….. and here. ↓
Ah, so what the heck is happening? I can’t even guess this is a Next.js problem or Webpack problem or Chrome problem. (Next.js v12)
This is the weirdest problem I encountered ever in the web realm.