Turborepo fails when its nested two levels down. CustomerError: The 'node_modules' folder is missing the 'next' dependency. #2371
Labels
console-builds
Issues related to Amplify console builds
pending-triage
Incoming issues that need categorization
Environment information
Describe the bug
A monorepo that has turborepo managing only a subsection of the monorepo fails to deploy NextJS code. If the entire repo is a turborepo then Amplify seems to have no issues with deployment.
Eg: https://github.com/vercel/turborepo/tree/main/examples/basic
The above example deploys without issues.
However when you nest the turborepo under folders like apps/product-frontend like in the example below, it fails to detect the build artifacts as expected
Eg: https://github.com/a3har/turbo-test
It throws the error below.
[ERROR]: !!! CustomerError: The 'node_modules' folder is missing the 'next' dependency. This is required at runtime to run your application. If you are using a monorepo framework, you may need to do additionalsetup to ensure the necessary runtime dependencies are included in the build output directory Read more: https://github.com/aws-amplify/amplify-hosting/blob/main/FAQ.md#using-a-monorepo-framework
Reproduction steps
Clone the public repo https://github.com/a3har/turbo-test and use the below build settings to deploy.
Env Variables:
AMPLIFY_MONOREPO_APP_ROOT=apps/product-frontend/apps/docs
AMPLIFY_DIFF_DEPLOY=false
The text was updated successfully, but these errors were encountered: