-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify CLI Custom CDK - Cannot read properties of undefined (reading 'category') #13138
Comments
I have been using these resources as a guide, still with the error.
Essentially trying to implement a step function invoked by the graphql api I have on my project, with a lambda function as the first step. |
Hey @samturner3, thank you for reaching out, I was able to reproduce the issue. We are currently looking into a workaround, tried removing the node modules ,yarn.lock and then build which did not mitigate the issue. Reproduction steps:
however, removing the custom resource entirely
running build did not throw any errors |
@samturner3 noticed some additional information. Does the custom resource folder have a
if not, could you create file with the above contents and build the project |
I followed your instructions ( Yes It does have a I'll continue restoring my code and see if I run into any more issues. |
This error is again popping up with the correct package.json config. Even the force |
Hey @samturner3, could you provide us the output by running |
I am hesitant to do any more testing on my project as it seems to be working ok now. |
I understand, please feel in reaching out to us again if you need any further assistance. |
|
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v16.16.0
Amplify CLI Version
12.2.4
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
When building or pushing a custom resource CDK stack, get error
Cannot read properties of undefined (reading 'category')
when using basic example code.Expected behavior
Expected to build successfully.
Reproduction steps
{ category: 'function', resourceName: 'fetchFlightsFn' }
amplify push
Project Identifier
d7b341914af3ff80145ba75e9ea4eb36
Log output
Additional information
I think this is very similar to #13122.
There the suggested fix is to use specific versions. My versions in
amplify/backend/custom/customResource7f1c64f3/package.json
I have set them the same as the other issue suggests but still encounter the issue.
Is there a build/install step that needs to be performed when editing this? Or is running
amplify build
/amplify push
the correct steps?Related Eslint issue
Also when I enable TS eslint linting on the file (
amplify/backend/custom/customResource7f1c64f3/cdk-stack.ts
) including the rule@typescript-eslint/prefer-nullish-coalescing
and enable"strictNullChecks": true
intsconfig.json
, I get warnings that'amplifyResourceProps' is possibly 'undefined'.
. Which is interestingly related to the console error :Cannot read properties of undefined (reading 'category')
So I then made amplifyResourceProps non-nullable (remove the
?
) which makes the eslint error go away.However after this the error still exists on
amplify push
.I have been battling with this for days and tried many examples online only to be blocked by this issue over and over again. 😢
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: