forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

sfdx commands --json erroring out #567

Closed surajp closed 2 years ago

surajp commented 4 years ago

Summary

I am on the latest cli version (7.70.1, windows installer version) and sfdx commands --json seems to be erroring out with the following message, in both powershell and command prompt:

TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurable and writable for property 'prototype' which is non-configurable, non-writable in the proxy target

Steps To Reproduce:

  1. Install latest Salesforce CLI (7.70.1) using the windows installer
  2. Run sfdx commands --json or sfdx commands -j

Expected result

Commands should be printed to the console in json format.

Actual result

TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurable and writable for property 'prototype' which is non-configurable, non-writable in the proxy target

SFDX CLI Version(7.70.1):

SFDX plugin Version(49.6.1)

OS and version: Windows 10. Version 2004

amphro commented 4 years ago

This works fine for me @surajp - what is the output of sfdx plugins

AlexVallat commented 3 years ago

@amphro I am experiencing this error too. On SFDX 7.75.0-5521f40d11

However, it only happens on the second and subsequent times sfdx commands --json is called, the first time it works fine. Running sfdx update (even though there is no update available) will reset whatever is causing this and the single next time sfdx commands --json is called it will work.

Output of sfdx plugins, as requested, is: no plugins installed

surajp commented 3 years ago

@amphro I switched to the node version of cli since I needed sfdx commands to work

amphro commented 3 years ago

I was able to reproduce. As a workaround, if you don't need the full power --json, you can use --output=json will give you just the information defined by the columns.

AlexVallat commented 3 years ago

Thanks for the suggestion, but I need all the command parameters and descriptions too (for my PowerShell autocomplete script. The issue seems to be with the force:lightning:lint command, although I couldn't see any obvious reason for it.

mshanemc commented 3 years ago

@AlexVallat @surajp is this still a problem? I don't have a windows box for easily reproducing it

mshanemc commented 3 years ago

cf: W-8257246

uip-robot-zz commented 3 years ago

This issue has been linked to a new work item: W-9299212

AlexVallat commented 3 years ago

I can confirm that this still occurs with sfdx-cli 7.101.0, salesforcedx 51.12.0

The output of a second run of sfdx commands --json is now:

(node:41524) [editions-autoloader-none-broadened] Error Plugin: sfdx-cli: editions-autoloader-none-broadened: Unable to determine a suitable edition, even after broadening.
module: @oclif/config@1.17.0
task: runHook init
plugin: sfdx-cli
root: C:\Users\Alexander\AppData\Local\sfdx\client\7.101.0-5e36989
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
    TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurable and writable for property
    'prototype' which is non-configurable, non-writable in the proxy target

(although the broadening message appears on all commands, so I think can be ignored as unrelated for this bug)

mshanemc commented 3 years ago

This looks like maybe a node16 error (not specific to the CLI, but see it other places I googled).

If you installed from a binary (.exe intaller for windows) please try sfdx update stable-rc which should take you back to node 14/LTS.

If you have an npm-based install (like npm install sfdx-cli -g) can you say what node --version responds with?

AlexVallat commented 3 years ago

Running sfdx update stable-rc results in sfdx-cli 7.103.0, salesforcedx 51.14.0, and has resolved the broadening error, thanks!

The json issue is still present. Running sfdx commands --json the first time after the udpate works, running it again produces

    TypeError: 'getOwnPropertyDescriptor' on proxy: trap reported non-configurable and writable for property
    'prototype' which is non-configurable, non-writable in the proxy target
no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

AlexVallat commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

Um, no? Bad bot. Please re-open.

mshanemc commented 3 years ago

Bad robot!

no-response[bot] commented 3 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

surajp commented 3 years ago

My observations are consistent with @AlexVallat . Works first time after update and then starts failing. I am on version sfdx-cli/7.104.0 win32-x64 node-v12.14.1