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

Cdktf get: Cannot read property 'dots' of undefined #1113

Closed
dzirg44 opened this issue Oct 3, 2021 · 15 comments · Fixed by #1116
Closed

Cdktf get: Cannot read property 'dots' of undefined #1113

dzirg44 opened this issue Oct 3, 2021 · 15 comments · Fixed by #1116
Labels
bug Something isn't working cdktf-cli confirmed independently reproduced by an engineer on the team dependencies Auto-pinning

Comments

@dzirg44
Copy link

dzirg44 commented Oct 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

    "cdktf": "^0.6.3",
    "constructs": "^10.0.5"
    "cdktf-cli": "^0.6.3",
Node.js v14.17.6

Affected Resource(s)

cdktf get - step

Debug Output

https://gist.github.com/dzirg44/0d3d67950620e701e11b25c17be90064

Expected Behavior

Get required providers/modules

Actual Behavior

Error

Steps to Reproduce

npx cdktf-cli init --local --template=typescript
npm install @cdktf/provider-aws
npm install -D cdktf-cli
npm run get

Important Factoids

I use Fedora 34

@dzirg44 dzirg44 added bug Something isn't working new Un-triaged issue labels Oct 3, 2021
@jsteinich
Copy link
Collaborator

This seems likely to be caused by vadimdemedes/ink-spinner#12.

npm i -g cli-spinners@2.6.0 might be a way to workaround.

@nadworny
Copy link

nadworny commented Oct 4, 2021

hey @jsteinich , I tried npm i -g cli-spinners@2.6.0 but without success.

@LeonidLapshinAquaCloud
Copy link

Hey, @nadworny

npm install --global cdktf-cli@0.6.2 cli-spinners@2.6.0
npm install @cdktf/provider-azurerm
....

cdktf-cli and cli-spinners should be in one command I guess

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

Hi!
I just found another workaround for TypeScript users: Install the cdktf-cli locally (e.g. as a devDependency) and also add a dependency to cli-spinners@2.6.0 – this way that version will be used.
Example:

npx cdktf-cli init --local --template=typescript
npm install @cdktf/provider-aws
npm install -D cli-spinners@2.6.0 # <-- depend directly on this version
npm install -D cdktf-cli
npm run synth

(Running get without any dependencies fails and you don't need to run get for prebuilt providers)

For users of other languages I just added a similar hard dependency to cli-spinners@2.6.0 to our cdktf-cli: #1116.

#881 would probably have prevented this kind of issue – and should prevent this in the future.

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

The pre-release version is available as npm install -g cdktf-cli@0.6.3-pre.361.
But we're also going to be releasing a proper release for this (#1117).

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

Hi @dzirg44!
We've just released 0.6.4 – Could you try to install that version and confirm that this is resolved? I tried it locally and it works now for me.

@sergio-deras
Copy link

Is this going to be applied only to version 0.6.4 ?
We are using 0.4.1 at the moment and we have just faced the same issue this morning.

@diegoitaliait
Copy link

diegoitaliait commented Oct 4, 2021

workaround

in the folder global node_modules/cdktf-cli/node_modules/ink-spinner/build/index.js

e.g.

/home/YOURUSER/.nvm/versions/node/v12.16.3/lib/node_modules/cdktf-cli/node_modules/ink-spinner/build/index.js

change the line 12 from this

const spinner = cli_spinners_1.default[type];

to this

const spinner = cli_spinners_1['dots'];

ps: i know that is dirty, but it works 😁
ps2: i'm the guy who find the bug, trust me i'm an engineer

@dzirg44
Copy link
Author

dzirg44 commented Oct 4, 2021

@ansgarm it seems that it resolved the issue, although I faced with another issue

RangeError: Maximum call stack size exceeded

in the node_modules/cdktf/lib/util.js:62
but I think it would be better to create another bug and mention this bug there, or maybe it is just my mistake.
Thank you all guys .

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

Hi @dzirg44, did that occur when running cdktf get for the aws provider? If yes, that's something we addressed in #1101.
But yeah, please feel free to file a separate bug for that 👍

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

Hi @sergio-deras!
Which target language are you using the CDKTF with? The workaround I mentioned should work with older versions of the cdktf as well, however it is geared towards as TypeScript / JavaScript project.

@dzirg44
Copy link
Author

dzirg44 commented Oct 4, 2021

@ansgarm no on cdktf synth , but I have to investigate it deeper.

@ansgarm
Copy link
Member

ansgarm commented Oct 4, 2021

Oh, sounds like something else – feel free to file an issue either way. Even if you encounter that there was some kind of loop in your code or so. So that we can see whether we could've prevented it somehow 🕵️

@ansgarm
Copy link
Member

ansgarm commented Oct 11, 2021

Going to close this, as this has been fixed in 0.6.4. If anyone needs a workaround for an older version, please file a new issue and we'll find one 👍

@ansgarm ansgarm closed this as completed Oct 11, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working cdktf-cli confirmed independently reproduced by an engineer on the team dependencies Auto-pinning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants