Custom Resources (CDK) throws error "Cannot convert undefined or null to object"
See original GitHub issueBefore opening, please confirm:
- I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- 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)
# Put schemas below this line
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot convert undefined or null to object - Stack Overflow
This error is caused when you call a function that expects an Object as its argument, but pass undefined or null instead, like...
Read more >Getting "Cannot convert undefined or null to object" when ...
Getting the below error message when running the sls deploy command. D:\Mobile Apps\ACT-Nurse-Portal\API\ACTNextGen-Services\timeSheets>sls ...
Read more >Runtime context - AWS Cloud Development Kit (AWS CDK) v2
Context values that are set by the AWS CDK Toolkit (the cdk command) can be set automatically, from a file, or from the...
Read more >@aws-cdk/custom-resources | Yarn - Package Manager
Custom Resource Execution Policy · Physical Resource Id Parameter · Handling Custom Resource Errors · Customizing the Lambda function implementing the custom ...
Read more >How do I find my custom attributes after calling noticeError?
Custom error attributes won't appear in the Browser UI. ... Cannot convert undefined or null to object\n at hasOwnProperty ()\n at r ([…...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @alonsnir, wanted to reopen this issue as this would enable the Amplify team to provide better error messaging.
@ykethan thanks for further details and the test. I guess my code was initially failing with empty template and then, after adding some custom resources for some other reasons. Thanks