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

Typescript compile errors when using 1.20.0 or 1.19.0 #5717

Closed
bo67192 opened this issue Jan 8, 2020 · 2 comments
Closed

Typescript compile errors when using 1.20.0 or 1.19.0 #5717

bo67192 opened this issue Jan 8, 2020 · 2 comments
Assignees
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@bo67192
Copy link

bo67192 commented Jan 8, 2020

I'm first tried to run cdk deploy <stack_name>, and I was seeing several errors like

node_modules/@aws-cdk/aws-codepipeline-actions/lib/action.d.ts:31:17 - error TS7033: Property 'pipeline' implicitly has type 'any', because its get accessor lacks a return type annotation.

31     private get pipeline();

When I pin to version 1.18.0 npm run build works fine.

Reproduction Steps

Here is my package.json

{
  "name": "dt-tsplus-infra",
  "version": "0.1.0",
  "bin": {
    "dt-tsplus-infra": "bin/dt-tsplus-infra.js"
  },
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "test": "jest",
    "cdk": "cdk"
  },
  "devDependencies": {
    "@aws-cdk/assert": "1.18.0",
    "@types/jest": "^24.0.25",
    "aws-cdk": "1.18.0",
    "jest": "^24.9.0",
    "ts-jest": "^24.3.0",
    "ts-node": "^8.5.4",
    "typescript": "~3.6.2"
  },
  "dependencies": {
    "@aws-cdk/aws-codebuild": "1.18.0",
    "@aws-cdk/aws-codedeploy": "1.18.0",
    "@aws-cdk/aws-codepipeline": "1.18.0",
    "@aws-cdk/aws-codepipeline-actions": "1.18.0",
    "@aws-cdk/aws-ec2": "1.18.0",
    "@aws-cdk/aws-elasticloadbalancingv2": "1.18.0",
    "@aws-cdk/aws-iam": "1.18.0",
    "@aws-cdk/aws-route53": "1.18.0",
    "@aws-cdk/aws-s3": "1.18.0",
    "@aws-cdk/aws-ssm": "1.18.0",
    "@aws-cdk/core": "1.18.0",
    "source-map-support": "^0.5.9"
  }
}

And then I'm importing and creating a pipeline.

Error Log

tsc

node_modules/@aws-cdk/aws-codepipeline-actions/lib/action.d.ts:31:17 - error TS7033: Property 'pipeline' implicitly has type 'any', because its get accessor lacks a return type annotation.

31     private get pipeline();
                   ~~~~~~~~

node_modules/@aws-cdk/aws-codepipeline-actions/lib/action.d.ts:32:17 - error TS7033: Property 'stage' implicitly has type 'any', because its get accessor lacks a return type annotation.

32     private get stage();
                   ~~~~~

node_modules/@aws-cdk/aws-codepipeline-actions/lib/action.d.ts:38:17 - error TS7033: Property 'scope' implicitly has type 'any', because its get accessor lacks a return type annotation.

38     private get scope();
                   ~~~~~

node_modules/@aws-cdk/aws-codepipeline/lib/pipeline.d.ts:239:17 - error TS7033: Property 'crossRegion' implicitly has type 'any', because its get accessor lacks a return type annotation.

239     private get crossRegion();
                    ~~~~~~~~~~~

node_modules/@aws-cdk/aws-ecs/lib/base/base-service.d.ts:321:17 - error TS7033: Property 'defaultLoadBalancerTarget' implicitly has type 'any', because its get accessor lacks a return type
annotation.

321     private get defaultLoadBalancerTarget();
                    ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@aws-cdk/core/lib/stack.d.ts:425:17 - error TS7033: Property 'assetParameters' implicitly has type 'any', because its get accessor lacks a return type annotation.

425     private get assetParameters();
                    ~~~~~~~~~~~~~~~


Found 6 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-01-08T17_34_36_548Z-debug.log
root@5d5b25b963ef:/dt-tsplus-infra/cdk# exit
exit

Environment

  • CLI Version :1.20.0
  • Framework Version: 1.18.0
  • OS : Windows 10
  • Language : typescript

Other


This is 🐛 Bug Report

@bo67192 bo67192 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2020
@skinny85
Copy link
Contributor

skinny85 commented Jan 8, 2020

Hey @bo67192 ,

if your version have ^ (like "@aws-cdk/aws-codepipeline": "^1.18.0"), see #5497 .

Thanks,
Adam

@SomayaB SomayaB added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. package/tools Related to AWS CDK Tools or CLI and removed needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2020
@SomayaB SomayaB self-assigned this Jan 8, 2020
@bo67192
Copy link
Author

bo67192 commented Jan 8, 2020

Changing my devDependencies typescript entry to

^3.7

Fixed the problem. Should I close this issue?

@bo67192 bo67192 closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants