Error: connection.deploy is not a function

241 views
Skip to first unread message

Satish P

unread,
Oct 19, 2021, 8:56:33 PM10/19/21
to Illuminated Cloud General Discussion
Scott - 

I'm having issues with Deploying SFDX source into scratch org. 
Keep getting error "connection.deploy is not a function"
both from command line and also from Illuminated menu option push/deploy. Please advise. 

Here's the command that i'm trying 
sfdx force:source:deploy -p custom-metadata -u <scratch_org_alias> -w 20

Custom-metadata is a folder in the project. 

Thanks, Satish

Scott Wells

unread,
Oct 19, 2021, 9:04:36 PM10/19/21
to Illuminated Cloud General Discussion, Satish P
Hi. It sounds like this question is less about Illuminated Cloud 2 and more about SFDX since you're able to reproduce the issue directly from the command-line. I'm happy to try to help even so, but if my advice doesn't help to resolve the issue you're seeing, you're probably better looking for help in the Salesforce CLI public issue tracker.

First, are the contents of the custom-metadata folder in source format or metadata format? If you're not certain what I mean by that, are the files under there named, for example, Foo.object-meta.xml or Foo.object? My guess is that it's the former which is source format, and that's the correct match for the force:source:deploy command (vs. metadata format which uses the force:mdapi:deploy command), but it's worth asking just in case.

If that's all good, the next thing I'd do--and trust me, it's a worthwhile step to take--is a scorched earth reinstall of the Salesforce CLI. I've seen time and time again CLI installs get into a bad state over time after repeated in-place updates, and I've seen the resulting issues fixed by just uninstalling and reinstalling. You won't lose your authorized orgs or anything. The uninstall instructions are posted here:


Make sure to remove EVERYTHING, then install a fresh copy and see if it's still happening directly from the command-line. If so, I'd recommend you post a bug in the CLI issue tracker linked above.

Regards,
Scott Wells

Satish P

unread,
Oct 19, 2021, 9:20:25 PM10/19/21
to Illuminated Cloud General Discussion, sc...@illuminatedcloud.com, Satish P

Hi Scott –

It’s a fresh install on a new client PC. So, I don’t think issue with SFDC version.

custom-metadata folder in source format

 

Here’s some additional log I see in the console. Please advise.          Thank you very much! You have been awesome!

 

 

 

Error: EMFILE: too many open files, open 'C:\Users\Jeeva\AppData\Local\sfdx\CLIID.txt'

    at Object.openSync (fs.js:497:3)

    at Object.writeFileSync (fs.js:1528:35)

    at Telemetry.getCLIId (C:\Program Files\sfdx\client\node_modules\@salesforce\plugin-telemetry\lib\telemetry.js:149:22)

    at Telemetry.record (C:\Program Files\sfdx\client\node_modules\@salesforce\plugin-telemetry\lib\telemetry.js:188:35)

    at process.<anonymous> (C:\Program Files\sfdx\client\node_modules\@salesforce\plugin-telemetry\lib\hooks\telemetryPrerun.js:39:23)

    at process.emit (events.js:412:35)

    at doEmitWarning (internal/process/warning.js:70:11)

    at processTicksAndRejections (internal/process/task_queues.js:81:21) {

  errno: -4066,

  syscall: 'open',

  code: 'EMFILE',

  path: 'C:\\Users\\Jeeva\\AppData\\Local\\sfdx\\CLIID.txt'

}

(node:10596) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled w

ith .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

(node:10596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Scott Wells

unread,
Oct 19, 2021, 9:21:40 PM10/19/21
to Illuminated Cloud General Discussion, Satish P, Scott Wells
Okay. Yeah, that's all CLI-specific stuff. Your best bet is to log a bug in their issue tracker. I apologize that I'm not able to help you more than that, but this isn't my wheelhouse, and someone much more adept at debugging CLI issues like Shane McLaughlin is going to get you to a solution much quicker than I can.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages