aws-amplify / aws-amplify/amplify-cli

`Cannot convert undefined or null to Object` when attempting to push with an empty custom CDK resource

Open
#11,341 5 comments 0 reactions 0 assignees View on GitHub
bug extensibility p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

v16.16.0

### Amplify CLI Version

10.4.0

### What operating system are you using?

Ubintu

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

Custom added

### Amplify Categories

custom

### Amplify Commands

push

### Describe the bug

Added AWS CDK custom resource, pushed all worked ok. Now adding another CDK custom resource and push is failing with error.
I suspect it might be the same as #1393

### Expected behavior

Be able to have more than one custom resource

### Reproduction steps

```
$ amplify add custom A
select AWS CDK
$ amplify push
$ amplify add custom B
select AWS CDK
$ amplify push
Cannot convert undefined or null to object
```

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.