Skip to content
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

tslint: Assets parent identified as different Construct type #1137

Closed
costleya opened this issue Nov 10, 2018 · 2 comments
Closed

tslint: Assets parent identified as different Construct type #1137

costleya opened this issue Nov 10, 2018 · 2 comments
Labels
bug This issue is a bug.

Comments

@costleya
Copy link
Contributor

costleya commented Nov 10, 2018

const buildInstructions = new FileAsset(this, 'DotnetDevexPipelineBuildInstructions', {
    path: './content/build.sh'
});

yields

Type 'DotnetDevexPipelineStack' is not assignable to type 'Construct'.
    Types of property 'parent' are incompatible.
      Type 'import("/Users/costleya/Work/dotnet-devex-pipeline/node_modules/@aws-cdk/cdk/lib/core/construct").Construct | undefined' is not assignable to type 'import("/Users/costleya/Work/dotnet-devex-pipeline/node_modules/@aws-cdk/assets/node_modules/@aws-cdk/cdk/lib/core/construct").Construct | undefined'.
        Type 'import("/Users/costleya/Work/dotnet-devex-pipeline/node_modules/@aws-cdk/cdk/lib/core/construct").Construct' is not assignable to type 'import("/Users/costleya/Work/dotnet-devex-pipeline/node_modules/@aws-cdk/assets/node_modules/@aws-cdk/cdk/lib/core/construct").Construct'.
          Types have separate declarations of a private property '_children'.
@costleya costleya added bug This issue is a bug. @aws-cdk/assets Related to the @aws-cdk/assets package labels Nov 10, 2018
@eladb
Copy link
Contributor

eladb commented Nov 11, 2018

This is supposed to be fixed in >0.15.2 as we introduced peer dependencies (#1091, #979). The problem is not specific to assets, it's because you have two versions of @aws-cdk/cdk in your closure and TypeScript won't allow you to interchangeably use them.

Closing for now, let us know if this persists with the latest version

@eladb eladb closed this as completed Nov 11, 2018
@eladb eladb removed the @aws-cdk/assets Related to the @aws-cdk/assets package label Nov 11, 2018
@NukaCody
Copy link

To elaborate on this error in case someone reached this page later like I did. While you're developing in typescript and adding new services you may run into an issue where all of your aws-cdk/aws-{someservice} is running on 1.6.0. But the new package you installed will be version 1.6.1 and will give you an error every time you're using "this." Easy fix with npm upgrade command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants