Issue Rebuilding NextJS Static Site with "Clear build cache & Deploy" Option

Hi guys, we’re running into a build issue with our NextJS Static Site. Things work fine if I build using the “Deploy latest build” option, but trying to use “Clear build cache and Deploy” option doesn’t. We need to clear cache because we need to hit or CMS for fresh information, but the build pipeline is stuck with the old data.

here are the logs:

Oct 22 05:56:03 PM ==> Cloning from https://github.com/eenistudios/cafeeast-site
Oct 22 05:56:06 PM ==> Checking out commit aa774807d262ad063d13c214bddaa7dbb52b99da in branch main
Oct 22 05:56:09 PM ==> Using Node version 21.0.0 via /opt/render/project/src/package.json
Oct 22 05:56:09 PM ==> Docs on specifying a Node version: Setting Your Node.js Version | Render Docs
Oct 22 05:56:12 PM ==> Using Ruby version 2.6.8 (default)
Oct 22 05:56:12 PM ==> Docs on specifying a Ruby version: Specifying a Ruby Version | Render Docs
Oct 22 05:56:25 PM ==> Installing dependencies with npm…
Oct 22 05:56:54 PM npm ERR! code E404
Oct 22 05:56:54 PM npm ERR! 404 Not Found - GET https://registry.npmjs.org/tar-stream/-/tar-streAM%20-%203.1.6.tgz - Not found
Oct 22 05:56:54 PM npm ERR! 404
Oct 22 05:56:54 PM npm ERR! 404 ‘tar-stream@https://registry.npmjs.org/tar-stream/-/tar-streAM%20-%203.1.6.tgz’ is not in this registry.
Oct 22 05:56:54 PM npm ERR! 404
Oct 22 05:56:54 PM npm ERR! 404 Note that you can also install from a
Oct 22 05:56:54 PM npm ERR! 404 tarball, folder, http url, or git url.
Oct 22 05:56:54 PM
Oct 22 05:56:54 PM npm ERR! A complete log of this run can be found in: /opt/render/.cache/_logs/2023-10-22T16_56_26_050Z-debug-0.log

Thanks
Sam

The issue looks like the name of a dependency isn’t being declared properly.

https://registry.npmjs.org/tar-stream/-/tar-streAM - 03.1.6.tgz

Should be

https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz

This actually looks like it might be an issue with our package-lock.json!

Turns out we had an issue with our package-lock.json! Will close issue