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

Extension doesn't load #5437

Closed
emkaix opened this issue Apr 24, 2019 · 33 comments · Fixed by #5443
Closed

Extension doesn't load #5437

emkaix opened this issue Apr 24, 2019 · 33 comments · Fixed by #5443
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@emkaix
Copy link

emkaix commented Apr 24, 2019

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 (ViewOutput, 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



@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Apr 24, 2019
@tirmisula
Copy link

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

@sumkire
Copy link

sumkire commented Apr 24, 2019

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

@hxhc
Copy link

hxhc commented Apr 24, 2019

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

@charlesHsuGG
Copy link

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.

@DonJayamanne
Copy link

@emkaix @hxhc @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.

@DonJayamanne
Copy link

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

@hxhc
Copy link

hxhc commented Apr 24, 2019

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)

@DonJayamanne

@FrancisJen
Copy link

that is a very bad user feeling

@Ehco1996
Copy link

meet this problem too!

@FrancisJen
Copy link

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

@derobertson
Copy link

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

@primary-student
Copy link

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 : -)

@fileszero
Copy link

fileszero commented Apr 24, 2019

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.

@Spacebody
Copy link

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

@hxhc
Copy link

hxhc commented Apr 24, 2019

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.

For Chinese users, delete the last comma in the zh-cn json file, and it should work. This is a bit awkward.

@Spacebody
Copy link

@hxhc I am so curious about the reason. This can be a temporal solution. Thanks

@hxhc
Copy link

hxhc commented Apr 24, 2019

@Spacebody It may be just a syntax error, because there should not be any commas in the last line of a json file. I think it can be fixed very soon.

@primary-student
Copy link

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.

Very targeted solution :)

@ywyt738
Copy link

ywyt738 commented Apr 24, 2019

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.

For Chinese users, delete the last comma in the zh-cn json file, and it should work. This is a bit awkward.

nice.
It works

@s1973
Copy link

s1973 commented Apr 24, 2019

similar issue

  • VS Code version: 1.33.1
  • OS and version: win10 1803 x64
  • Python version: 3.6.1

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

one more thing

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.

For Chinese users, delete the last comma in the zh-cn json file, and it should work. This is a bit awkward.

It works for me, 感谢 @hxhc

@liguobao
Copy link

as list:

package.nls.de.json
package.nls.es.json
package.nls.fr.json

package.nls.ko-kr.json

package.nls.zh-cn.json

package.nls.zh-tw.json

contains "," ....

@frostming
Copy link

I even reinstalled VSCode, then I found this issue.

@archtaurus
Copy link

Come on, please fix this asap!

@shty32
Copy link

shty32 commented Apr 24, 2019

I also reinstalled VSCode many times, but solve this problem by rollback this extension to the last version.

@zruijie
Copy link

zruijie commented Apr 24, 2019

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

Thanks! It does work for me! But I suggest you disable auto update option.

@whitestarlau
Copy link

Downgrade the Python extension is useful to me. This bug makes me feel terrible.

@zruijie
Copy link

zruijie commented Apr 24, 2019

Downgrade the Python extension is useful to me. This bug makes me feel terrible.

Then, you should disable auto update option.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 24, 2019
@DonJayamanne
Copy link

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

@emkaix
Copy link
Author

emkaix commented Apr 24, 2019

Thank you very much

@Hcyang-NULL
Copy link

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 !

@yqren2005
Copy link

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

@aldanor
Copy link

aldanor commented May 18, 2019

@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?

@aldanor
Copy link

aldanor commented May 18, 2019

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...)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.