aws / aws/aws-cdk

(core): (asset bundling message is printed to stderr)

Open
#23,092 8 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/core effort/small feature-request good first issue p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Prior to asset bundling aws-cdk prints a message: "Bundling asset ...". This message is written to stderr despite not being an error itself. This leads to some build systems (Rush for instance) failing as they are confirming stderr in addition to the process return code.

### Expected Behavior

stderr should be reserved for error messages

### Current Behavior

"Bundling asset {path}" information message is printed to stderr

### Reproduction Steps

- Within a CDK application include a NodejsFunction:
```
const lambdaService = new nodejsLambda.NodejsFunction(this, 'dea-app-handler', {
memorySize: 512,
vpc,
role: role,
timeout: Duration.minutes(3),
runtime: Runtime.NODEJS_16_X,
handler: 'handler',
entry: path.join(__dirname, '/../src/backend-api-lambda.ts'),
depsLockFilePath: path.join(__dirname, 'pnpm-lock.yaml'),
bundling: {
externalModules: ['aws-sdk'],
logLevel: LogLevel.ERROR,
},
});
```
- Run synth and observe stderr output
`cdk synth 1>out 2>err`

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.51.1

### Framework Version

_No response_

### Node.js Version

v16.17.0

### OS

Mac OSX 12.6

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the NodejsFunction reproduction and run `cdk synth 1>out 2>err` using the shown bundling settings. Trace where the “Bundling asset {path}” message is emitted and verify that it no longer appears in stderr while actual errors still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.