NX+Nextjs Build failing with error

Hi, since yesterday all our builds that use NX and Nextjs are failing with error:

11:57:37 AM:  >  NX   Cannot read properties of undefined (reading 'name')
11:57:37 AM: TypeError: Cannot read properties of undefined (reading 'name')
11:57:37 AM:     at findAllNpmDeps (/opt/build/repo/node_modules/.pnpm/nx@15.9.2/node_modules/nx/src/plugins/js/package-json/create-package-json.js:107:30)
11:57:37 AM:     at findAllNpmDeps (/opt/build/repo/node_modules/.pnpm/nx@15.9.2/node_modules/nx/src/plugins/js/package-json/create-package-json.js:130:17)
11:57:37 AM:     at findAllNpmDeps (/opt/build/repo/node_modules/.pnpm/nx@15.9.2/node_modules/nx/src/plugins/js/package-json/create-package-json.js:130:17)
11:57:37 AM:     at createPackageJson (/opt/build/repo/node_modules/.pnpm/nx@15.9.2/node_modules/nx/src/plugins/js/package-json/create-package-json.js:34:5)
11:57:37 AM:     at /opt/build/repo/node_modules/.pnpm/@nrwl+next@15.9.7_@babel+core@7.23.7_@babel+traverse@7.23.7_@types+express@4.17.21_@types+nod_g4nsp3xofsqd7xpjtdzzbtq4bm/node_modules/@nrwl/next/src/executors/build/build.impl.js:41:61
11:57:37 AM:     at Generator.next (<anonymous>)
11:57:37 AM:     at fulfilled (/opt/build/repo/node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.js:166:62)
11:57:37 AM:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

The codebase hasn’t been changed for a while on those projects.

Affected sites are:

  • igvs-acc
  • stroom-acc
  • www.ikgaverderstuderen.be
  • stroom.uantwerpen.be

What have I tried to resolve it:

  • Upgrade Netlify plugin to 5.8.1
  • Upgrade Node to 18.20.4
  • Upgrade Nextjs to 13.5.4

None of this steps have resolved the issue.

This is quite urgent as our client cannot deploy new content to their websites. Could you please have a look?

Thank you in advance!

With kind regards,
Max

Here’s an example build: Netlify

It seems that rebuild with clear cache helped. Not an issue anymore.

glad to hear it! thanks for writing back in and sharing you were able to resolve your issue.