(aws-cdk): Synth not working when testing against locally developed node modules patterns
See original GitHub issueWe have a situation where we develop a node package (call it package A) with cdk patterns we create for our company and then distribute them out to other teams to use. The problem we are running into is when we try to test our package locally (via npm link r yarn link) using a local package (call it package B) we run into Argument of type 'this' is not assignable to parameter of type 'Construct'.
errors seeming to stem from the --prefer-ts-exts
flag in the cdk.json. It looks like this flag is now added by default to the cdk.json file as of version 1.75.0. We are wondering if there is a way around these errors so we can develop and test our package (A) locally without running into this issue. We could remove the flag from the cdk.json but we would like to avoid that if possible, seeing that we will have to do this for each new project we create. We also get more weird behavior, and sometimes the error goes away, if we either remove or add specific packages (whether we actually consume them or not) to the package (B) we are using to test our patterns (from package A).
To clarify, we are creating package A, which contains the patterns we are developing. We then have a package B which consumes the patterns from package A to test them locally before releasing the package. When testing locally, we do a yarn/npm link from package B to A which then throws the above errors when we run a synth because package A has both .ts and .js files (since we are building it locally).
Environment
- CDK CLI Version: 1.85.0 (build 5f44668)
- Module Version: 1.83.0
- Node.js Version: v14.15.1
- OS: macOS Catalina
- Language (Version): Typescript (~3.7.2)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top GitHub Comments
Thank you very much @rcollette, this is likely the source of the issue originally posted
I’m sure people who hate this error will be happy when v2 is GA 😉
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.