8

From one day to the other I am unable to create scratch orgs using the command which worked before:

sfdx force:org:create -f /Users/path/to/scratch-def.json -a MY_ORG -v DevHub -s -d 30

I receive this error:

Cannot read property 'timeout' of undefined.

A scratch org gets created BUT it has not the alias MY_ORG, which make other scripts fail.

This seems to be machine related as this works on other machines as before. My CLI is up-to-date and other commands work.

5
  • 1
    Same for me as soon as I moved to the latest plugin version (sfdx-cli/6.36.0-391bf95737 - salesforcedx 44.3.0) Oct 22 '18 at 13:42
  • 1
    I tried several things, and installing the pre-release fixed the issue. So I assume it's a bug that's already known and will be fixed with the next version of the CLI. In the meantime you can try to install the pre-release version: sfdx plugins:install salesforcedx@pre-release Oct 22 '18 at 15:15
  • Thanks Fabien. That indeed solved my problem. If you add it as answer I will accept it. Oct 23 '18 at 8:43
  • Done, cool to see it solved your issue too :) Oct 23 '18 at 8:45
  • This is usually a problem with the wrong dependencies getting installed somehow. The salesforce-alm module should be pointing to sfdx-core 0.23.1 where the problem is fixed. If you somehow have a previous version stuck in the modules, you will see this error. Can you try to uninstall pre-release and give the output of sfdx plugins --core ande look to see what your version of core you have in ~/.local/share/sfdx/client/node_modules/@salesforce/sfdx-core/package.json.
    – Amphro
    Oct 23 '18 at 18:26
3

This has come up before when the salesforcedx plugin is relying on an updated version of @salesforce/core but, for some reason, there is an old version in the CLI node_modules.

Although installing salesforcedx@pre-release fixed this for you, that tag is no longer being updated now that v44 has moved to latest so you won't get any further updates. Instead, I would recommend updating to latest. sfdx plugins:uninstall salesforcedx to remove your pre-release version, then sfdx plugins:install salesforcedx (same as sfdx plugins:install salesforcedx@latest) to install off the latest tag. If you see the problem off latest, this would give us more information.

If you want to help us figure out why dependencies aren't getting updated, then you can uninstall pre-release, give the output for sfdx plugins --core and the contents of ~/.local/share/sfdx/client/node_modules/salesforce-alm/package.json.

Update:

Based on the feedback, installing and uninstalling salesforcedx fixes the problem. It is usually best to keep salesforcedx so you get the updated one bundled with the CLI releases that are autoupdated. If anyone gets the error and wants to post the request information above, we can continue to debug the issue.

5
3

I tried several things, and installing the pre-release fixed the issue. So I assume it's a bug that's already known and will be fixed with the next version of the CLI. In the meantime you can try to install the pre-release version: sfdx plugins:install salesforcedx@pre-release.

5
  • I would prefer not to have this as the solution because you are just hiding the issue.
    – Amphro
    Oct 23 '18 at 18:22
  • Just add a better answer. When it solves my problem without a prerelease CLI I will choose that one. Oct 23 '18 at 19:51
  • 1
    @Amphro I wanted to ping you, but it seems this was fix in the pre-release so didn’t want to ping you for nothing. Would be happy to have details on the issue + the fix. Real answer: just open source the CLI. Oct 23 '18 at 21:01
  • My point being, this is just masking the issue. As far as we know, this shouldn't be an issue and there is was nothing specific that fixed this in pre-release or latest. In fact, pre-release is no longer being updated until v45 get's moved over to pre-release. So my theory is some NPM module is getting munged. I'll put more details in an answer.
    – Amphro
    Oct 23 '18 at 21:31
  • @Amphro: Is there any reason why the CLI can't be somewhat close-source but have a public issues page on Github? Oct 24 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.