1 Answer
- Newest
- Most votes
- Most comments
3
Module '"../lib/sample-api-stack"' has no exported member 'SampleApiStack' points exactly at the root cause.
https://github.com/fortejas/example-serverless-python-api/blob/main/lib/sample-api-stack.ts exports ServerlessApiStack, not SampleApiStack!
CDK behavior explanation:
cdk.jsondefines command to compile your CDK application:"app": "npx ts-node --prefer-ts-exts bin/sample-api.ts"bin/sample-api.tshas the following import generated by CDK init command:import { SampleApiStack } from '../lib/sample-api-stack';- you replaced the generated file with a custom one, which exports a different class
- TypeScript fails to compile your code and CDK exists with the error above
Relevant content
- asked 2 years ago
- asked 4 years ago
- asked 2 years ago

Thank you so much. I understand now After deploying the application, I was getting the following error when i access
curl -d POST https://0am0475yv4.execute-api.ap-southeast-2.amazonaws.com/prod/update
The same thing happened to me, I had a custom class name.