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

Examples do not compile against latest master #175

Closed
t0yv0 opened this issue Oct 17, 2024 · 1 comment · Fixed by #176
Closed

Examples do not compile against latest master #175

t0yv0 opened this issue Oct 17, 2024 · 1 comment · Fixed by #176
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@t0yv0
Copy link
Member

t0yv0 commented Oct 17, 2024

What happened?

I think the recent change #167 is good but we need to have the examples in repo updated (that also serve as tests). Apparently the wrong code is being tested, not the release candidate but some older version.

Example

cd examples/ec2-instance
npm i ~/code/pulumi-cdk
pulumi preview
Diagnostics:
  pulumi:pulumi:Stack (pulumi-aws-cdk-ec2-instance-dev):
    error: Running program '/Users/anton/code/pulumi-cdk/examples/ec2-instance/' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(10,9): error TS2554: Expected 2-3 arguments, but got 1.
    index.ts(21,33): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
      Type 'Ec2CdkStack' is not assignable to type 'Construct'.
        Types of property 'node' are incompatible.
          Type 'import("/Users/anton/code/pulumi-cdk/node_modules/constructs/lib/construct").Node' is not assignable to type 'import("/Users/anton/code/pulumi-cdk/examples/ec2-instance/node_modules/constructs/lib/construct").Node'.
            Types have separate declarations of a private property 'host'.
    index.ts(33,53): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(40,35): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(53,46): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(62,33): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(75,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(77,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(80,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(84,14): error TS2339: Property 'synth' does not exist on type 'Ec2CdkStack'.

Output of pulumi about

N/A

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 17, 2024
@t0yv0
Copy link
Member Author

t0yv0 commented Oct 17, 2024

I was trying to debug this test locally to try to get at a repro case for #171 but run into this need a little help catching up.

@t0yv0 t0yv0 removed the needs-triage Needs attention from the triage team label Oct 18, 2024
corymhall added a commit that referenced this issue Oct 22, 2024
CDK libraries have a weird requirement that only a single version of
`aws-cdk-lib` and `constructs` be installed. This means that the
`devDependency` in `package.json` and the dependencies in each
`examples` `package.json` needs to be the same. If they are different
versions then the examples will fail with `Argument of type 'this' is not assignable to parameter of type 'Construct'.`

fixes #175
corymhall added a commit that referenced this issue Oct 23, 2024
CDK libraries have a weird requirement that only a single version of
`aws-cdk-lib` and `constructs` be installed. This means that the
`devDependency` in `package.json` and the dependencies in each
`examples` `package.json` needs to be the same. If they are different
versions then the examples will fail with `Argument of type 'this' is
not assignable to parameter of type 'Construct'.`

Note: the `peerDependency` is still a floating version so users can
still install the range of versions.

fixes #175
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants