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

[VSCode "OSS"] Extension activation fails: "Can't access Proposed APIs" #262

Closed
avanderhoorn opened this issue Apr 27, 2018 · 8 comments
Closed

Comments

@avanderhoorn
Copy link
Member

avanderhoorn commented Apr 27, 2018

ArchLinux/Manjaro Users: Use https://aur.archlinux.org/packages/visual-studio-code-bin to avoid this problem.

Non-offical distributions of Visual Studio Code can be missing a critical value in product.json file that prevents Visual Studio Live Share from activating. In this case, if you go to Help > "Toggle Developer Tools", you will see stack traces indicating the Live Share extension did not activate due to it using a "proposed API."

To verify this is your issue, check the contents of product.json. The file can be located as follows:

  • Windows - C:\Program Files\Microsoft VS Code\resources\app\product.json
  • Linux - /usr/share/code/resources/app/product.json
    • Depending on your distribution, exact location may vary.
  • Mac - /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/product.json

If the extensionAllowedProposedApi property is missing or you do not see "ms-vsliveshare.vsliveshare" referenced, you are using an unofficial version with this problem. Contact the VS Code distribution owner to get the issue patched.

As a workaround, you can add the following into the product.json:

    "extensionAllowedProposedApi": [         
      "ms-vsliveshare.vsliveshare",         
      "ms-vscode.node-debug",         
      "ms-vscode.node-debug2"    
 ]
@Chuxel
Copy link
Member

Chuxel commented Apr 27, 2018

For Solus Linux, this was located at /usr/share/vscode/resources/app/product.json

See #215 for this and other issues related to Solus.

EDIT: This particular issue is resolved for Solus with the latest vscode package. libcurl should also be resolved soon.

@Chuxel Chuxel changed the title [VSCode] Can't access Proposed APIs [VSCode] Extension activation fails: "Can't access Proposed APIs" Apr 27, 2018
@Chuxel Chuxel changed the title [VSCode] Extension activation fails: "Can't access Proposed APIs" [VSCode "OSS"] Extension activation fails: "Can't access Proposed APIs" Apr 27, 2018
@ghost
Copy link

ghost commented May 8, 2018

Same issue here, But I would like to say, My Visual Studio Code is offical distributions.Namely, The Visual Studio Code above can not be missing a critical value in product.json file.

image

@grork
Copy link

grork commented May 8, 2018

Are you running the latest insiders build, just released?

@IllusionMH
Copy link

IllusionMH commented May 8, 2018

@grork It worked for me yesterday on Windows 10 with

Version 1.24.0-insider
Commit d29620f2ba89327f51bb6fb2f05dfdd65e2fcafe
Date 2018-05-07T08:55:27.483Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Stopped to work after update today:

Version 1.24.0-insider
Commit 8a07c8d935998d1b1153dde0c5b337189d35cea0
Date 2018-05-08T05:16:07.736Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

I can see that this problem is reproducible on 2 PCs. Both have correct values in product.json

"extensionAllowedProposedApi": [
    "ms-vsliveshare.vsliveshare",
    "ms-vscode.node-debug",
    "ms-vscode.node-debug2"
]

@avanderhoorn
Copy link
Member Author

Update, there has been a regression in the latest version of VS Code Insiders which has caused a regression in how they manage proposed APIs. Unfrotunately this has caused issues for us and resulted in the errors you mentioned above. Fortunately, the VS Code team is rolling out a fix to insiders which rectifies this regression and it should be generally available tomorrow.

@yume-chan
Copy link

@avanderhoorn I'm on the latest official insiders build for Windows x64, but the "Proposed API" issue still exists.

My full version info:

Version 1.24.0-insider
Commit dbd7f09189947497c77755d0738c115d689c680f
Date 2018-05-22T05:17:48.854Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

evandrocoan added a commit to evandroforks/vscode that referenced this issue Aug 15, 2018
@fubaduba
Copy link
Contributor

This issue is has been closed due lack of any recent activity. We've made lots of improvements to Live Share since this issue. Please re-open the issue, if this issue persists.
🤖Live-Share-Clean-Up-Bot🤖

@alfredopalhares
Copy link

I know that this is a closed issue. but here is a Python Script for the lazy to fix that:

#!/usr/bin/env python

import os
import json

VSCodeProductPath = "/usr/lib/code/product.json"

if not os.path.exists(VSCodeProductPath) or not os.access(VSCodeProductPath, os.W_OK):
    print("ERROR: Insuficient permissions or did not find VSCode Product file:", VSCodeProductPath)
    exit(1)

VSCodeProduct = open(VSCodeProductPath, "r")
data = json.load(VSCodeProduct)

# We need to ensure the extensionAllowedProposedApi has the following array:
extensionsToAdd = [
        "ms-vsliveshare.vsliveshare",
        "ms-vscode.node-debug",
        "ms-vscode.node-debug2"
]
print("Before:", data["extensionAllowedProposedApi"])

for extension in extensionsToAdd:
    if extension not in data["extensionAllowedProposedApi"]:
        data["extensionAllowedProposedApi"].append(extension)

print("After:", data["extensionAllowedProposedApi"])
print("Rewriting to file:", VSCodeProductPath)

VSCodeProduct = open(VSCodeProductPath, "w")
json.dump(data, VSCodeProduct,  indent=4)

You file location might changes, this works on Arch Linux, since everytime the package is updated you need to re-fix the product.json file.

Mikejo5000 pushed a commit that referenced this issue Nov 11, 2022
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/microsoftdocs/live-share (branch main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants