Any idea why am I getting typescript errors? `erro...
# typescript
g
Any idea why am I getting typescript errors?
error TS2339: Property 'send' does not exist on type 'ECSClient'
when I run
pulumi preview
but everything is fine in IDE
Copy code
import {ECSClient,ListServicesCommand} from "@aws-sdk/client-ecs";
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";
const clusterName = "myCluster"
const myService = "myService"
const ecsClientPromise = aws.getRegion(undefined, { parent: this }).then((r) => new ECSClient({ region: r.name }))

const serviceArn = ecsClientPromise.then(async (ecsClient) => { 

  const listServicesOutput = await ecsClient.send(new ListServicesCommand({
    cluster: clusterName,
  }))

  const serviceArn = listServicesOutput.serviceArns?.find((f: string)=>f.match(new RegExp(myService, 'g')))
  return serviceArn
});
pulumi.all([serviceArn]).apply(console.log)
p
First, it would be good to paste those errors 🙂 But as I pasted this in my IDE I clearly see some missing imports marked as red (I'm actually using PHP Storm, so Jetbrains IDE family)
g
thanks for pointing it out,
p
nice, good catch
g
it was not fix sadly
Because I am using
pnpm
I had to hoist
@aws-sdk
and
@smithy