Wordpress HTTP error and Cached Pages

Hi, my Next.js app works properly when I run it locally but there’s an error loading new posts from my wordpress backend.

I fixed the “HTTP error - mixed content” because of the SSL, but then there was another problem because I had cached copies of the first three blog posts in my /out/blog directory being loaded by netlify. After deleting them and pushing the new build to github, it’s still loading the old pages that don’t exist (with the same WordPress SSL/HTTP error).

How can I clear the locally deleted pages from the build that netlify is loading in order for my next.js app to load new content only?

Does the ‘Clear cache and build’ option help?

No, it didn’t. :sob:
I wonder if it’s something I did when writing the code? Why does it work properly locally but in the build command on netlify, it generated those pages again!
yarn build 3:27:10 PM: yarn run v1.22.4 3:27:10 PM: next build
3:27:11 PM: Browserslist: caniuse-lite is outdated. Please run:
3:27:11 PM: npx browserslist@latest --update-db
3:27:11 PM: info - Creating an optimized production build…
3:27:19 PM: info - Compiled successfully
3:27:19 PM: info - Collecting page data…
3:27:20 PM: info - Generating static pages (0/9)
3:27:21 PM: info - Generating static pages (2/9)
3:27:21 PM: info - Generating static pages (4/9)
3:27:22 PM: info - Generating static pages (6/9)
3:27:22 PM: info - Generating static pages (9/9)
3:27:22 PM: info - Finalizing page optimization…
3:27:22 PM: Page Size First Load JS
3:27:22 PM: ┌ ○ / 2.87 kB 71.3 kB
3:27:22 PM: ├ └ css/648b0f333b6ae3fe6148.css 20 B
3:27:22 PM: ├ /_app 0 B 65 kB
3:27:22 PM: ├ ○ /404 3.46 kB 68.4 kB
3:27:22 PM: ├ ○ /about 3.88 kB 68.8 kB
3:27:22 PM: ├ └ css/2c9f90b644348da48158.css 91 B
3:27:22 PM: ├ ● /blog (ISR: 1 Seconds) 780 B 69.2 kB
3:27:22 PM: ├ ● /blog/[slug] 869 B 69.3 kB
3:27:22 PM: ├ ├ /blog/dummy-post-3
3:27:22 PM: ├ ├ /blog/dummy-post-2
3:27:22 PM: ├ └ /blog/dummy-post-1

Those three blog dummy-post pages shouldn’t exist anymore.

Okay, taking a hard guess here, but does creating a new website altogether make any difference?

I guess I could try that as a last resort, but it was work moving my domain to netlify for this new project.

You can keep your current setup untouched, so in case that doesn’t work, you won’t have to redo anything. But if it does work, you’d be back on track.

Deleting it and recreating from the same repo didn’t work, neither did assigning a new repo to it.
I found cached versions of those blog posts in the .next folder and deleted them along with a couple other files, thinking that yarn build would replace them, but now my site has no styling and I get a 404 error when I click on the links to those posts.

I opened a page from the /out directory locally and it looks like it does on Netlify, so the problem is not with Netlify.

1 Like