-
Notifications
You must be signed in to change notification settings - Fork 247
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
Causes JavaScriptError in AWS CDK api-gateway #3742
Comments
Now that CDK 2.41.0+ defines the |
Thanks for reporting. I'm able to reproduce the issue. This is because I attempted to simplify the assembly load procedure by leveraging runtime-type-information woven in by the compiler... which may return FQNs that are actually not exported by the assembly, triggering this bug. |
When a jsii module returned a private class implementation of an interface, consuming `jsii.rtti` data may return an FQN for the internal class, which does not exist in foreign languages, leading to an error. Revert to tagging FQNs directly instead. Fixes #3742
When a jsii module returned a private class implementation of an interface, consuming `jsii.rtti` data may return an FQN for the internal class, which does not exist in foreign languages, leading to an error. Revert to tagging FQNs directly instead. Fixes #3742
Interesting - the The fix I designed still would work there... The best strategy might be to have RTTI not be woven for deprecated types that will be pruned, but this might end up requiring a huge refactor... This might hence still be the best fix. |
When a jsii module returned a private class implementation of an interface, consuming jsii.rtti data may return an FQN for the internal class, which does not exist in foreign languages, leading to an error. Revert to tagging FQNs directly instead. Fixes #3742
|
Describe the bug
When using the AWS CDK api gateway Model.EMPTY_MODEL (or ERROR_MODEL) the cdk stacks cannot synthesize or deploy.
Expected Behavior
The AWS CDK will not error when using the api gateway Model.EMPTY_MODEL
Current Behavior
@jsii/kernel.SerializationError: Of static property aws-cdk-lib.aws_apigateway.Model.EMPTY_MODEL: Unable to serialize value as aws-cdk-lib.aws_apigateway.IModel
🛑 Failing value is an instance of aws-cdk-lib.aws_apigateway.EmptyModel
EmptyModel { modelId: 'Empty' }
╰── 🔍 Failure reason(s):
╰─ Type 'aws-cdk-lib.aws_apigateway.EmptyModel' not found
at Object.process (/tmp/tmpdm_u1x99/lib/program.js:6194:19)
Reproduction Steps
use a Java cdk project and include this anywhere ...
Map<String, IModel> emptyResponseModels = new HashMap<>(); emptyResponseModels.put("application/json", Model.EMPTY_MODEL);
Use 1.67.0 of this library and the error occurs.
Possible Solution
No response
Additional Information/Context
revert back to 1.66.0 to overcome the problem.
SDK version used
AWS CDK 2.37.1
Environment details (OS name and version, etc.)
Windows 10
The text was updated successfully, but these errors were encountered: