Topic: Next.js App Directory Build Issue

Rosalind priority asked 1 year ago


Steps taken

  • Create a Next.js app with create-next-app, enabling the new app directory feature
  • Create an app/page.tsx file
  • Install the MDB library
  • Import any MDB component into that app/page.tsx file
  • Run npm run build

Expected behavior

I expected the build to complete without issue.

Actual behavior

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: Vt.registerables is not iterable (cannot read property undefined)

I was able to resolve this issue by changing Vt.Chart.register(...Vt.registerables); to Vt.Chart.register(...Vt.registerables || []); in the source code of the MDB library, but this is obviously not the best fix. It's unclear if there are other things broken/not working with this fix, as I've only been able to just get the npm run build command working again.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 6.0.0
  • Device: M1 Macbook Pro
  • Browser: N/A
  • OS: Mac
  • Provided sample code: Yes
  • Provided link: No