ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.26k stars 287 forks source link

Faced Vercel Error with NEXT #476

Open jakesungjaekim opened 1 year ago

jakesungjaekim commented 1 year ago
스크린샷 2023-06-27 오후 11 48 30

Here's the situation. I customized an external library via patch-package. After that, another change point is created and committed, and Vercel occur error like that.

Deleting and reinstalling the node module or deleting and recreating the patch file does not solve the problem.

i appreciate that if you give some advice. thx.

andyjy commented 1 year ago

I suspect this is due to Vercel's build process caching node_modules. (At least it was for me.)

You can resolve by viewing the specific failing deployment within Vercel and selecting "Redeploy" (ensuring the "reuse existing build cache" option is disabled).

This should deploy successfully with no node_modules cache - and then cache the correctly-patched package for future builds up until you modify the patch again, at which point you just need to repeat the one-off manual redeploy to resolve again.

jakesungjaekim commented 1 year ago

@andyjy i appreciate your advice, thx dude !!

iba-1 commented 1 year ago

@jakesungjaekim if you're deploying using webhook you can also disable node_modules caching by appending this parameter to the URL ?buildCache=false Additional info here: https://vercel.com/docs/concepts/deployments/deploy-hooks#build-cache