aws-samples / aws-samples/bedrock-chat

[BUG] NodejsBuild Failed for FrontendReactBuild

Open
#863 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
TypeScript
Stars
1.3k
Forks
535
Avg merge
1d 12h
Merged PRs (30d)
10

Description

## 🚨 **Please Note** 🚨

To ensure efficient investigation of the issue, please fill out the fields below with as much detail as possible. **Reports that do not follow this template may be closed without notification.** We appreciate your cooperation.

## 🐞Describe the bug

Trying to deploy the project without modifying it, using npx cdk deploy --require-approval never --all. I get:
`BedrockChatStack | 123/155 | 4:52:33 PM | CREATE_FAILED | Custom::CDKNodejsBuild | Frontend/ReactBuild/Resource/Default (FrontendReactBuildE02FF220) Received response status [FAILED] from custom resource. Message returned: NodejsBuild failed. See CloudWatch Log stream for the detailed reason: https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Fcodebuild$252FFrontendReactBuildProject48-EwWhshH3QNZo/log-events/362dfaae-5d4f-4e94-8c24-6ffd2cf4da3e (RequestId: aa50310d-e3f5-4255-95df-e29610479119)`

If I follow the cloudwatch url, I don't get anything useful:

`[Container] 2025/05/14 14:52:25.975186 Command did not exit successfully eval "$buildCommands" exit status 1
[Container] 2025/05/14 14:52:25.984673 Phase complete: BUILD State: FAILED
[Container] 2025/05/14 14:52:25.984686 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: eval "$buildCommands". Reason: exit status 1
[Container] 2025/05/14 14:52:26.030997 Entering phase POST_BUILD
[Container] 2025/05/14 14:52:26.032483 Running command echo Build completed on `date`
Build completed on Wed May 14 14:52:26 UTC 2025
 
[Container] 2025/05/14 14:52:26.047565 Running command
STATUS='SUCCESS'
if [ $CODEBUILD_BUILD_SUCCEEDING -ne 1 ] # Test if the build is failing
then
STATUS='FAILED'
REASON="NodejsBuild failed. See CloudWatch Log stream for the detailed reason:
https://$AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$AWS_REGION#logsV2:log-groups/log-group/\$252Faws\$252Fcodebuild\$252F$projectName/log-events/$CODEBUILD_LOG_PATH"
fi`

Build fails but I am unable to debug, and I didn't modify the code. It is the latest version from v3 branch.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the deployment from the v3 branch with `npx cdk deploy --require-approval never --all`, then inspect the linked CloudWatch CodeBuild log for the command that fails before the generic `NodejsBuild failed` message. The issue provides no source file or test to target; done means identifying and fixing the deployment failure and confirming the unchanged project deploys successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, react, typescript
Domain
build-system, cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.