chapter6 vercel deploy error
if you try running pnpm build on your local project, you should get a warning like:
Ignored build scripts: bcrypt. │
│ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.
As the warning suggests, run pnpm approve-builds and select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.
if you try running
pnpm buildon your local project, you should get a warning like:Ignored build scripts: bcrypt. │ │ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.As the warning suggests, run
pnpm approve-buildsand select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.
This is supposed to work, but if it doesn't, you can try the other solution proposed in https://github.com/pnpm/pnpm/issues/9042#issuecomment-2638094544
The proposed solution is to manually add this option into your package.json file:
"pnpm": { "onlyBuiltDependencies": [ "bcrypt" ] }
I solve it by using ’ import from "bcryptjs" ‘ replace ’ import from "bcrypt" ‘
bcryptjs
Which file you made the change?
bcryptjs
Which file you made the change?
you can search which file include import "bcrypt"
I had the same issue. I imported bcryptjs and removed bcrypt. This worked for me.
in the terminal write this
pnpm remove bcrypt
pnpm add bcryptjs
if you try running
pnpm buildon your local project, you should get a warning like:Ignored build scripts: bcrypt. │ │ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.As the warning suggests, run
pnpm approve-buildsand select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.
i didn't get any warning like this when trying to build locally but your solution did indeed work.
https://github.com/vercel/next-learn/issues/1034