Invalid value at 'function' (oneof), oneof field 'source_code' is already set. Cannot set 'sourceUploadUrl'

606 Views Asked by At

Cloud Code v1.22.0-insiders.0

I installed the Cloud Code extension for VSCode to work with my cloud functions locally.

After authorizing, when I click cloud functions section on the cloud code nav tab, I see the cloud function I want to work one with a green 'Active' checkmark.

When I hover over the cloud function and click "Download to new workspace" I do so, which installs the folder to a local dir.

I then tried making a one line amendment and deploying this test change by clicking "Deploy Function" under workspace Local.

This results in 2 error messages:

Invalid value at 'function' (oneof), oneof field 'source_code' is already set. Cannot set 'sourceUploadUrl'

And

Error running command cloudcode.functions.deployFunction: Invalid value at 'function' (oneof), oneof field 'source_code' is already set. Cannot set 'sourceUploadUrl'. This is likely caused by the extension that contributes cloudcode.functions.deployFunction.

enter image description here

How can I upload/sync my changes using this extension?

1

There are 1 best solutions below

3
On BEST ANSWER

It looks like this happens when a Gen 1 function is created via a Zip file in the Cloud Console. This is a bug in Cloud Code, we're working on a fix to push out in the next update. In the meantime, Gen 2 functions, or Gen 1 functions created using the inline editor should work, but Gen 1 functions created using a Zip will run into this issue with no workaround at this time; sorry for the inconvenience while this issue persists.