probably a dependency issue but when I start a new...
# help
b
probably a dependency issue but when I start a new project and a create an
sst.Bucket
inside a class that extends
cdk.Construct
I get the following error
new Bucket(_this_, "Bucket");
Copy code
Type 'ConstructNode' is missing the following properties from type 'Node': _locked, _children, _context, _metadata, and 6 more.
here are the deps:
Copy code
"devDependencies": {
    "@aws-cdk/aws-iam": "^1.149.0",
    "@aws-cdk/aws-ssm": "^1.149.0",
    "@serverless-stack/cli": "0.69.2",
    "@serverless-stack/resources": "0.69.2",
    "@tsconfig/node14": "^1.0.1",
    "@types/aws-lambda": "^8.10.70",
    "@types/node": "<15.0.0",
    "aws-cdk-lib": "2.15.0",
    "typescript": "4.4.4"
  }
any pointers please?
r
It might be due to a mismatch in cdk versions, you should use
aws-cdk-lib/aws-iam
and
aws-cdk-lib/aws-ssm
b
from what I can see, there are basically 2
Construct
, one in
node_modules/constructs
and another in
node_modules/@aws_cdk/core
and their
node
property have different types:
ConstructNode
and
Node
node_modules/constructs
is version 10.0.91
node_modules/@aws_cdk/core
is version 1.149.0 and imports
construct
version ^3.3.69
r
Did you try what I suggested?
b
yep, it made things worse, before I made things better in a nutshell, move from using
@aws-cdk/aws-xxx
to
aws-cdk-lib/aws-xxx
and replace
import { Construct } from "@aws-cdk/core"
with
_import_ { Construct } _from_ "constructs"
t
I've gotten this too but never went around to fixing it
sometimes I wonder if it's really worth creating a real construct vs just making a normal function
b
the above solved it for me I know you're working on a functional programming version of all of sst, it will make all of this much less painful
c
You solved it doing what Ross suggested if I'm not mistaken. Poor guy 😄
r
I’m thick skinned