Skip to content

Extension doesn't load #5437

Closed
Closed

Description

Environment data

  • VS Code version: 1.33.1
  • Extension version (available under the Extensions sidebar): 2019.4.11881
  • OS and version: 5.0.7-1-MANJARO
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

VS Code loading the extension

Actual behaviour

VS Code doesn't load the extension

Steps to reproduce:

  1. Install newest version (2019.4.11881)
  2. Restart VS Code

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

N/A

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

extensionHost.ts:311 [Extension Host] debugger listening on port 26793
extensionService.ts:802 Couldn't find message for key python.snippet.launch.unitTests.description.
_logMessageInConsole @ extensionService.ts:802
extensionService.ts:800 Activating extension 'ms-python.python' failed: Unexpected token } in JSON at position 2364.
_logMessageInConsole @ extensionService.ts:800
console.ts:134 [Extension Host] Activating extension `ms-python.python` failed:  Unexpected token } in JSON at position 2364
t.log @ console.ts:134
console.ts:134 [Extension Host] Here is the error stack:  SyntaxError: Unexpected token } in JSON at position 2364
	at JSON.parse (<anonymous>)
	at d (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:39446)
	at Object.module.exports.Object.defineProperty.value (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:39801)
	at n (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:279)
	at Object.module.exports.r.__decorate.o (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:24:39416)
	at n (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:279)
	at Object.module.exports.r.__decorate.o (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:24:36365)
	at n (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:279)
	at Object.<anonymous> (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:9:89881)
	at n (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:279)
	at module.exports.Object.defineProperty.value (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:1078)
	at Object.<anonymous> (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:1:1089)
	at Object.<anonymous> (/home/mkx/.vscode/extensions/ms-python.python-2019.4.11881/out/client/extension.js:85:3)
	at Module.t._initNodeRequire.r._compile (/opt/visual-studio-code/resources/app/out/vs/loader.js:16:90)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
	at Module.load (internal/modules/cjs/loader.js:620:32)
	at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
	at Function.Module._load (internal/modules/cjs/loader.js:551:3)
	at Function.t._load (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:729:537)
	at Function.t.getExtensionPathIndex.then.a._load (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:691:639)
	at Function.t.getExtensionPathIndex.then.r._load (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:655:197)
	at Module.require (internal/modules/cjs/loader.js:658:17)
	at require (internal/modules/cjs/helpers.js:20:18)
	at Function.i [as __$__nodeRequire] (/opt/visual-studio-code/resources/app/out/vs/loader.js:31:542)
	at /opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:717:918
	at E._doActivateExtension (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:718:2)
	at E._activateExtension (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:716:772)
	at E.<anonymous> (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:714:224)
	at Generator.next (<anonymous>)
	at n (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:11:176)
	at new Promise (<anonymous>)
	at n (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:10:975)
	at Object.actualActivateExtension (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:713:946)
	at p._activateExtension (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:457:765)
	at define._activateExtensions.i.length.Promise.all.o.map.e (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:457:449)
	at Array.map (<anonymous>)
	at p._activateExtensions (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:457:437)
	at p.activateByEvent (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:455:375)
	at E._activateByEvent (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:715:434)
	at define.$activateByEvent._readyToRunExtensions.wait.then.t (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:723:359)
console.ts:134 [Extension Host] [vscode-icons] v8.6.0 activated!
notificationsAlerts.ts:38 Error: command 'python.setInterpreter' not found
    at Proxy._tryExecuteCommand (commandService.ts:60)
    at r.then.i (commandService.ts:53)
    at process._tickCallback (internal/process/next_tick.js:68)
onDidNotificationChange @ notificationsAlerts.ts:38



Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Apr 24, 2019
  2. tirmisula commented on Apr 24, 2019

    @tirmisula

    I have similar issue.

    • VS Code version: 1.33.1
    • OS and version: Mojave 10.14.1
    • Python version: 3.7.3
    [Extension Host] Activating extension `ms-python.python` failed:  Unexpected token } in JSON at position 1946
    t.log @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:235
    
  3. sumkire commented on Apr 24, 2019

    @sumkire

    me too
    VS Code version: 1.33.1
    OS and version: win 10.0.17763.437
    Python version: 3.7.2

    [Extension Host] Activating extension ms-python.python failed: Unexpected token } in JSON at position 1946

  4. hxhc commented on Apr 24, 2019

    @hxhc

    similar issue.

    VS Code version: 1.33.1
    Extension version (available under the Extensions sidebar): 2019.4.11881
    OS and version: win 10.0.17763.437
    Python version: 3.6.3 (Anaconda)
    Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    NA

    [2019-04-24 10:13:15.227] [exthost] [info] eager extensions activated
    [2019-04-24 10:13:25.408] [exthost] [info] ExtensionService#_doActivateExtension vscode.python {"startup":false,"activationEvent":"onLanguage:python"}
    [2019-04-24 10:13:25.408] [exthost] [info] ExtensionService#loadCommonJSModule c:\Program Files\Microsoft VS Code\resources\app\extensions\python\out\pythonMain
    [2019-04-24 10:13:25.410] [exthost] [info] ExtensionService#_doActivateExtension njpwerner.autodocstring {"startup":false,"activationEvent":"onLanguage:python"}
    [2019-04-24 10:13:25.410] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\hxhc\.vscode\extensions\njpwerner.autodocstring-0.3.0\out\extension.js
    
  5. charlesHsuGG commented on Apr 24, 2019

    @charlesHsuGG

    also similar issue too.
    i fix this to early extension version, i think this problem on new extension version, maybe wait someone fix this bug.
    and dont forgot close auto update on vs code.

  6. DonJayamanne commented on Apr 24, 2019

    @DonJayamanne

    Klaus Hahnenkamp (@emkaix) hxhc hsu (@sumkire)

    1. Are you using any language other than English in VS Code?

    2. Please could you try the following?

    • Open VS Code
    • Select the command Extensions: Open Extensions Folder
    • Locate the following directory ms-python.python-2019.4.11881
    • Go into the directory ms-python.python-2019.4.11881/out/client
    • Rename the file extension.js.map.disabled to extension.js.map
    • Reload VS Code
    • When extension fails (it should still fail), then go into the Console Window (Help->Toggle Developer Tools), and provide the details of the error message.

    It should now contain the line numbers of the errors.

  7. DonJayamanne commented on Apr 24, 2019

    @DonJayamanne

    Thats fine, I can replicate this at my end when using another language.
    Apologies for this, we'll fix this ASAP.

  8. hxhc commented on Apr 24, 2019

    @hxhc

    I am using English in Vscode, yet the system language is Chinese.

    The error message is below, hope it helps.

    Here is the error stack:  SyntaxError: Unexpected token } in JSON at position 1946
    	at JSON.parse (<anonymous>)
    	at d (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:39446)
    	at Object.module.exports.Object.defineProperty.value (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:39801)
    	at n (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:279)
    	at Object.module.exports.r.__decorate.o (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:24:39416)
    	at n (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:279)
    	at Object.module.exports.r.__decorate.o (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:24:36365)
    	at n (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:279)
    	at Object.<anonymous> (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:9:89881)
    	at n (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:279)
    	at module.exports.Object.defineProperty.value (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:1078)
    	at Object.<anonymous> (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:1:1089)
    	at Object.<anonymous> (C:\Users\hxhc\.vscode\extensions\ms-python.python-2019.4.11881\out\client\extension.js:85:3)
    	at Module.t._initNodeRequire.r._compile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:16:90)
    	at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    	at Module.load (internal/modules/cjs/loader.js:620:32)
    	at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    	at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    	at Function.t._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:729:537)
    	at Function.t.getExtensionPathIndex.then.a._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:691:639)
    	at Function.t.getExtensionPathIndex.then.r._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:655:197)
    	at Module.require (internal/modules/cjs/loader.js:658:17)
    	at require (internal/modules/cjs/helpers.js:20:18)
    	at Function.i [as __$__nodeRequire] (c:\Program Files\Microsoft VS Code\resources\app\out\vs\loader.js:31:542)
    	at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:717:918
    	at E._doActivateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:718:2)
    	at E._activateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:716:772)
    	at E.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:714:224)
    	at Generator.next (<anonymous>)
    	at n (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:11:176)
    	at new Promise (<anonymous>)
    	at n (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:10:975)
    	at Object.actualActivateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:713:946)
    	at p._activateExtension (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:457:765)
    	at define._activateExtensions.i.length.Promise.all.o.map.e (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:457:449)
    	at Array.map (<anonymous>)
    	at p._activateExtensions (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:457:437)
    	at p.activateByEvent (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:455:375)
    	at E._activateByEvent (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:715:434)
    	at define.$activateByEvent._readyToRunExtensions.wait.then.t (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:723:359)
    	at process._tickCallback (internal/process/next_tick.js68:7)
    

    Don Jayamanne (@DonJayamanne)

  9. FrancisJen commented on Apr 24, 2019

    @FrancisJen

    that is a very bad user feeling

  10. Ehco1996 commented on Apr 24, 2019

    @Ehco1996

    meet this problem too!

  11. FrancisJen commented on Apr 24, 2019

    @FrancisJen

    should I switch to pycharm or sublime? work is stopped..

  12. derobertson commented on Apr 24, 2019

    @derobertson

    should I switch to pycharm or sublime? work is stopped..

    You can right-click the Python extension in the extension tab and select a different version to install

  13. primary-student commented on Apr 24, 2019

    @primary-student

    The useful action for me is disable python automatic update and choose an old version for python extension.
    (I feel it's a syntax error : -)

  14. fileszero commented on Apr 24, 2019

    @fileszero

    I remove last extra comma from "C:\Users[username].vscode\extensions\ms-python.python-2019.4.11881\package.nls.[language].json."
    and restart vs code.
    it works.
    I'm using Japanese.

  15. Spacebody commented on Apr 24, 2019

    @Spacebody

    I face the same issue on my mac with

    OS version: Mojava 10.14.4
    VS code 1.33.1
    Extension version: 2019.4.11881

  16. 14 remaining items

  17. added a commit that references this issue on Apr 24, 2019
    730691c
  18. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 24, 2019
  19. added a commit that references this issue on Apr 24, 2019
    b24e2cb
  20. DonJayamanne commented on Apr 24, 2019

    @DonJayamanne

    Hi everyone, we'll be landing a fix for this issue ASAP.
    Apologies for the inconvenience caused.

  21. emkaix commented on Apr 24, 2019

    @emkaix
    Author

    Thank you very much

  22. Hcyang-NULL commented on Apr 24, 2019

    @Hcyang-NULL

    I remove last extra comma from "C:\Users[username].vscode\extensions\ms-python.python-2019.4.11881\package.nls.[language].json."
    and restart vs code.
    it works.
    I'm using Japanese.

    Thank you very much
    it really works !

  23. yqren2005 commented on May 18, 2019

    @yqren2005

    Downgrade the python extension fixed this issue for me. Can not believe it. You should FIX it ASAP!

  24. aldanor commented on May 18, 2019

    @aldanor

    Don Jayamanne (@DonJayamanne) Same here, but perhaps for a different reason.

    Tried building .vsix from the latest github master on a barely empty vscode install on macOS, ending up with "python.setInterpreter not found".

    Doesn't seem like there's invalid localization jsons, ~/.vscode/extensions/ms-python.python-2019.5.0-dev/package.nls.json seems correct with no extra commas.

    Looking at traceback in developer tools:

    workbench.main.js:3855 Activating extension 'ms-python.python' failed: 
    Cannot find module '~/.vscode/extensions/ms-python.python-2019.5.0-dev/out/client/extension'.
    

    And indeed, the folder out doesn't even seem to exist within extension's install folder. Why?

  25. aldanor commented on May 18, 2019

    @aldanor

    Nevermind, it loads, but you have to build it properly (i.e., npm run package etc instead of just vsce package - maybe there should be a few words in the readme how to build this extension from source...)

  26. locked as resolved and limited conversation to collaborators on Jun 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions