Why do I get this console output: ```stacks/Storag...
# help
a
Why do I get this console output:
Copy code
stacks/StorageStack.js (15,36): Type '"GET"' is not assignable to type 'HttpMethods'.
13.                   allowedHeaders: ["*"],
14.                   allowedMethods: ["GET", "PUT", "POST", "DELETE", "HEAD"],
15.                },
Seems weird to me, because "GET" is indeed in HttpMethods. Some Typescript thing I'm not getting?
This is CORS config for a Bucket, by the way
r
If you’re inside the
cdk.bucket
property you need to use the HttpMethods.GET enumeration value not the string.
a
ah, ok, thx. What's weird is that my IDE is not finding this enum for some reason, any idea why?
It's a new install of sst and i've already installed npm dependencies
r
Have you imported it?
Copy code
import {HttpMethods} from 'aws-cdk-lib/aws-s3';
a
well no, what I mean is that usually, I can just write the construct Name and the ide then finds it when i do ctrl + space
but not in this case
for example for the Bucket construct, it works
r
It seems to be a little hit and miss as whether my IDE automatically finds type from packages in node_modules. Sometimes I need to hunt them down myself
a
hmmm, okay, good to know, thanks
anyway, it seems to work with the HttpMethods.GET enum, thx
f
Thanks @Ross Coundon. How u spotted it’s inside
cdk.bucket
feels like magic to me 🤯