question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'replace' of undefined when starting LS on Arch

See original GitHub issue

Environment data

  • VS Code version: 1.30.0
  • Extension version (available under the Extensions sidebar): 2018.12.0
  • OS and version: Arch Linux
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Expected behavior

Python extension loads with the language server running.

Actual behavior

The extension never finishes loading (“Python extension loading…” forever), and instead throws an exception from the code added in 66f8a27.

Steps to reproduce:

  1. Start the extension with LS enabled on Arch.

Logs

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

Nothing is output.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

With the source map enabled:

  ERR Cannot read property 'replace' of undefined: TypeError: Cannot read property 'replace' of undefined
    at Object.SemVer [as parseVersion] (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/src/client/common/utils/version.ts:12:1)
    at parseVersion (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/src/client/common/platform/platformService.ts:142:1)
    at cb (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:66:1)
    at cb (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:125:51)
    at customLogic (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:63:1)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jakebaileycommented, Dec 14, 2018

I’m really confused as to what you’re asking me for that’s different than what I provided. The stack trace I am describing is in my original issue. This is not some sort of big pop up from the editor. Pasted again:

  ERR Cannot read property 'replace' of undefined: TypeError: Cannot read property 'replace' of undefined
    at Object.SemVer [as parseVersion] (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/src/client/common/utils/version.ts:12:1)
    at parseVersion (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/src/client/common/platform/platformService.ts:142:1)
    at cb (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:66:1)
    at cb (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:125:51)
    at customLogic (/home/jake/.vscode/extensions/ms-python.python-2018.12.0/node_modules/getos/index.js:63:1)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

I can run my script by clicking the “play” button just fine, which tells me that an exception gets thrown when trying to start the LS, the future that indicates that the LS has started doesn’t complete, and the “extension loading” message doesn’t disappear.

1reaction
matejcikcommented, Dec 14, 2018

I’m seeing the same thing, commenting to clarify that this only happens when Jedi is disabled, i.e., when using Microsoft Python Language server. Jedi server loads fine. The same problem happens whether the LS is installed (by previous version of the python extension) or not.

(sorry for the noise if “LS” means the Microsoft language server by default)

My OS is Linux Mint 19 otherwise same version info, this doesn’t seem to depend on Python version (affects multiple 3.x environments with or without virtualenvs)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'replace' of undefined
You are calling replace() on a variable that is undefined. If you debug your code you can easily ...
Read more >
TypeError: Cannot read property 'replace' of undefined - ionic-v3
Hi, @Sujan12 I am having the same problem as @cjacobm on Windows 10 x64. I have node v.8.2.1 and npm 5.3.0. Installed cordova...
Read more >
[SOLVED] Cannot Read Property 'replace' of Undefined in JS
To fix the “cannot read property 'replace' of undefined” error, perform an undefined check on the variable before calling the replace() method ......
Read more >
Dockerizing an Angular App - Michael Herman
The app errs out with a TypeError: Cannot read property 'foo' of undefined with the var 'foo' being a var supplied by environment.ts....
Read more >
cannot read properties of undefined (reading 'map') nodejs
setItem to cache the data of the created new booking. My Error in my console reads - TypeError: Cannot read properties of undefined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found