question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Resources (CDK) throws error "Cannot convert undefined or null to object"

See original GitHub issue

Before 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:open
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ykethancommented, Nov 14, 2022

Hey @alonsnir, wanted to reopen this issue as this would enable the Amplify team to provide better error messaging.

0reactions
alonsnircommented, Nov 14, 2022

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found