When running npm run build, it always exists with the following error:
> Build error occurred
[Error: Failed to collect page data for /api/user-management/settings/general] {
type: 'Error'
}
Ugh - that was it! Thank you.
Great! All the best with your projects
Thanks for your reply Sean.
I have redownloaded Metronic v9.2.1. The install is based on a fresh copy of the Nextjs Typescript project.
I copy the files into Ubuntu on WSL, run npm install --force, create the .env file with relevant secrets, then run npx prisma generate which successfully generates. Following that, I run npx prisma migrate dev which succeeds. npm run dev successfully serves the application showing the login screen with default credentials, and then redirecting to the dashboard after login.
Finally, I run npm run build which fails with the below output:
> metronic-nextjs@9.2.1 build
> next build
â² Next.js 15.3.2
- Environments: .env
Creating an optimized production build ...
[src/media_query.rs:1032:11]
â Compiled successfully in 51s
â Linting and checking validity of types
Collecting page data .ReferenceError: File is not defined
at 66962 (.next/server/app/api/user-management/settings/general/route.js:1:3801)
at t (.next/server/webpack-runtime.js:1:128)
at r (.next/server/app/api/user-management/settings/general/route.js:1:10104)
at <unknown> (.next/server/app/api/user-management/settings/general/route.js:1:10146)
at t.X (.next/server/webpack-runtime.js:1:1206)
at <unknown> (.next/server/app/api/user-management/settings/general/route.js:1:10117)
at Object.<anonymous> (.next/server/app/api/user-management/settings/general/route.js:1:10174)
> Build error occurred
[Error: Failed to collect page data for /api/user-management/settings/general] {
type: 'Error'
}
Hi,
We have tested the build of v9.2.1 and it worked well. Can you please make sure that you use the latest NPM version ? We have tested it with Nodejs v10.9.2 and above.
Regards,
Sean
Hi,
Sorry for the late reply. It seems we missed your question in our system.
May I know which version are you using ? Metronic 9.2.x Next.js or Vite ? Can you try the latest Metronic v9.2.1 by downloading it from your themeforest.net account ?
Regards,
Sean