- Newest
- Most votes
- Most comments
The error you're encountering suggests that there's an issue with permissions when trying to copy traced files during the build process. This is likely related to the output configuration in your Next.js setup.
To address this issue, try the following adjustments:
-
Remove the 'output: 'standalone'' line from your Next.js configuration. The standalone output can sometimes cause issues with file tracing and permissions in certain deployment environments.
-
Instead of using the '.next' directory as your baseDirectory in the amplify.yaml file, try using the following configuration:
artifacts: baseDirectory: / files: - '**/*' excludes: - some-excluded-file
This change allows Amplify to handle the file structure more flexibly.
-
Ensure that your Amplify app has the necessary permissions to access and modify files in the build environment. You may need to check and update the IAM role associated with your Amplify app to include sufficient permissions for CodeBuild operations.
-
If the issue persists, you might want to try setting the 'outputFileTracingRoot' in your Next.js config to the project root:
outputFileTracingRoot: path.join(__dirname),
These changes should help resolve the permission issues you're experiencing during the build process. If you continue to face problems, you may need to review your Amplify app's build settings and ensure all necessary permissions are in place.
Sources
Unable to pull container in CodeBuild project even with loose policy | AWS re:Post
AWS CodeBuild permissions reference - AWS CodeBuild
Allow users to interact with CodeBuild - AWS CodeBuild
answered a year ago
Relevant content
asked 4 years ago
