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

type error in typescript example #6530

Open
kumavis opened this issue Jan 27, 2025 · 3 comments
Open

type error in typescript example #6530

kumavis opened this issue Jan 27, 2025 · 3 comments
Labels
area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@kumavis
Copy link

kumavis commented Jan 27, 2025

type error in typescript example

maybe this is a mismatch in pulumi id vs digitalocean id?

File: themes/default/content//registry/packages/digitalocean/api-docs/reservedipassignment

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = new digitalocean.ReservedIp("example", {region: "nyc3"});
const exampleDroplet = new digitalocean.Droplet("example", {
    name: "baz",
    size: digitalocean.DropletSlug.DropletS1VCPU1GB,
    image: "ubuntu-22-04-x64",
    region: digitalocean.Region.NYC3,
    ipv6: true,
    privateNetworking: true,
});
const exampleReservedIpAssignment = new digitalocean.ReservedIpAssignment("example", {
    ipAddress: example.ipAddress,
    dropletId: exampleDroplet.id, // Type 'Output<string>' is not assignable to type 'Input<number>'.
});
Type 'Output<string>' is not assignable to type 'Input<number>'.
  Type 'Output<string>' is not assignable to type 'OutputInstance<number>'.
    Types of property 'apply' are incompatible.
      Type '{ <U>(func: (t: string) => Promise<U>): Output<U>; <U>(func: (t: string) => OutputInstance<U>): Output<U>; <U>(func: (t: string) => U): Output<...>; }' is not assignable to type '{ <U>(func: (t: number) => Promise<U>): Output<U>; <U>(func: (t: number) => OutputInstance<U>): Output<U>; <U>(func: (t: number) => U): Output<...>; }'.
        Types of parameters 'func' and 'func' are incompatible.
          Types of parameters 't' and 't' are incompatible.
            Type 'string' is not assignable to type 'number'.ts(2322)
reservedIpAssignment.d.ts(91, 5): The expected type comes from property 'dropletId' which is declared here on type 'ReservedIpAssignmentArgs'
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Jan 27, 2025
@kumavis
Copy link
Author

kumavis commented Jan 27, 2025

this solved the issue, but probably better to solve inside the digitalocean provider implementation dropletId: droplet.id.apply(id => parseInt(id, 10)),

@kumavis
Copy link
Author

kumavis commented Jan 27, 2025

@iwahbe iwahbe added kind/bug Some behavior is incorrect or out of spec awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. and removed needs-triage Needs attention from the triage team labels Jan 28, 2025
@iwahbe
Copy link
Member

iwahbe commented Jan 28, 2025

Hi @kumavis. Thanks for opening an issue. It looks like the appropriate upstream issues (pulumi/pulumi-digitalocean#600, pulumi/pulumi#17841) are the ones you linked, so there isn't much more to do here.

If you havn't already, I would 👍 pulumi/pulumi#17841, since that feeds back into issue prioritization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api-docs Generated API docs, generated from providers. For hand-written docs, see area/docs. awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants