nx: Random error happens on vercel
Current Behavior
Getting this same error so randomly in different apps
Error: Command "npx nx build <app name> --prod" exited with SIGTERM on vercel, fine on local build though. And by clicking redeploy will fix it.
Expected Behavior
Builds should pass without clicking redeploy to make them pass
Environment
` Node : 14.17.5 OS : darwin x64 yarn : 1.22.11
nx : 14.0.5 @nrwl/angular : Not Found @nrwl/cypress : 14.0.5 @nrwl/detox : Not Found @nrwl/devkit : 14.0.5 @nrwl/eslint-plugin-nx : 14.0.5 @nrwl/express : Not Found @nrwl/jest : 14.0.5 @nrwl/js : 14.0.5 @nrwl/linter : 14.0.5 @nrwl/nest : Not Found @nrwl/next : 14.0.5 @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : 14.0.5 @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.0.5 @nrwl/web : 14.0.5 @nrwl/workspace : 14.0.5 typescript : 4.6.4 rxjs : 6.6.7
Community plugins:
✨ Done in 1.51s.`
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 19 (2 by maintainers)
Update from the Vercel team on possible ways to fix this issue:
--skip-nx-cache(This will effectively skip the NX cache ⚠️)Experiencing the same problem.
My error is constant the same:
stack: "Error: Cannot find module 'typescript'\n" +But on manual redeploy it works.
I have the similar error on Vercel. If we disable the command for ignoring the build step (
npx nx-ignore frontend), it starts working with a cache as usual. However, it crashes with the following log for builds with the saved cache.Nx report:
This still happens.
This issue has been automatically marked as stale because it hasn’t had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Note: if you’re using
@nrwl/nx-cloudandNX_CACHE_DIRECTORYtogether, make sure you’re using version@nrwl/nx-cloud@14.6.0or greater.It looks like there was a bug prior to
14.6.0that did not respectNX_CACHE_DIRECTORYand always assumednode_modules/.cache/nxexisted, which could not be the case when installing withNX_CACHE_DIRECTORYand would cause an error when building.Don’t get your hopes up, happens with nx 14.4.2 as well 😦