You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build process fails with a "Module Not Found" error related to the bcrypt package. Specifically, the error message indicates that the native bindings for bcrypt cannot be located.
This issue occurs during the pnpm build command, specifically when Next.js is attempting to collect page data. The error prevents a production build from being created.
Environment
Next.js version: 15.1.6 (as per the tutorial)
pnpm version: 10.6.5
Node.js version: v20.18.0
Package Manager: pnpm
Additional Information
During pnpm install, the following warning was also displayed:
Warning
Ignored build scripts: bcrypt, sharp.
Run "pnpm approve-builds" to pick which dependencies should
be allowed to run scripts.
Possible Root Cause
The bcrypt package relies on native bindings, which may not be correctly compiled or located during the build process, especially in a Next.js environment. The warning about ignored build scripts could be related.
Suggested Solution/Workaround
A workaround that resolves the issue is to replace bcrypt with bcryptjs. bcryptjs is a pure JavaScript implementation and does not require native bindings.
pnpm remove bcrypt
pnpm add bcryptjs
Impact
This build failure prevents users from completing the Next.js dashboard tutorial and deploying a production-ready application.
Thank you for your attention to this matter. I hope this information is helpful in resolving the issue.
The text was updated successfully, but these errors were encountered:
Hi Team,
I'm encountering a build failure while following the Next.js dashboard tutorial (https://nextjs.org/learn/dashboard-app/getting-started). The issue occurs during the production build process (
pnpm build
).Description of the Issue
The build process fails with a "Module Not Found" error related to the
bcrypt
package. Specifically, the error message indicates that the native bindings forbcrypt
cannot be located.Context
This issue occurs during the
pnpm build
command, specifically when Next.js is attempting to collect page data. The error prevents a production build from being created.Environment
Additional Information
During
pnpm install
, the following warning was also displayed:Possible Root Cause
The
bcrypt
package relies on native bindings, which may not be correctly compiled or located during the build process, especially in a Next.js environment. The warning about ignored build scripts could be related.Suggested Solution/Workaround
A workaround that resolves the issue is to replace
bcrypt
withbcryptjs
.bcryptjs
is a pure JavaScript implementation and does not require native bindings.Impact
This build failure prevents users from completing the Next.js dashboard tutorial and deploying a production-ready application.
Thank you for your attention to this matter. I hope this information is helpful in resolving the issue.
The text was updated successfully, but these errors were encountered: