6

I'm encountering an issue with the Pylance extension in VS Code when working on a Python notebook. Sometimes if I add or delete a cell, the language server crashes and throws the following error:

Error: Debug Failure. False expression: Chained file path undefined doesn't match cellFilePaths [REDACTED PATH].ipynb:pylance-notebook-cell:W5sZmlsZQ==.py
    at _0x225e6a ([REDACTED PATH]\server.bundle.js:1:1015920)
    at [REDACTED PATH]\server.bundle.js:1:1023143
    at _0x32da0b.<computed> ([REDACTED PATH]\server.bundle.js:1:1023175)
    at _0x382c6c._onDidChangeNotebookDocumentAsync ([REDACTED PATH]\server.bundle.js:1:1001957)

Here's my setup:

  • VS Code Version: June 2023 (version 1.80)
  • Pylance Extension Version: 2023.8.21
  • Operating System: Windows 10 and Linux

Steps to reproduce:

  • Open a Jupyter notebook in VS Code.
  • Add or delete a cell.
  • The Pylance language server crashes with the above error.

Has anyone encountered this issue before? Any guidance or solutions would be greatly appreciated.

Thank you in advance!

I've already tried several troubleshooting steps:

  • Reinstalled VS Code.
  • Reinstalled the Pylance extension.
  • Updated both VS Code and Pylance to their latest versions.

Despite these efforts, the issue persists.

My primary goal is to have Pylance running smoothly within Jupyter notebooks in VS Code. If anyone has encountered and resolved this problem, or has any suggestions, I'd be very appreciative.

3 Answers3

2

This seems to be an instance of this known issue: Pylance crashing on Jupyter Notebook Cell Deletion #4685. The issue is known to exist for v2023.8.10 of the Pylance extension.

The issue is apparently fixed in prerelease version 2023.8.51. Try installing that release (if it's still in pre-release, switch to the pre-release channel).


Older info:

Apparently for many (but not all) users, the issue does not reproduce in Pylance v2023.7.40, so downgrading might be a possible workaround for now. You may or may not need to downgrade further than that to get a fix. See also VS Code - how to rollback extension/install specific extension version.

According to the maintainers, some of the issue-cases will be fixed by pull request #4733, which will be released in the upcoming pre-release version of the Pylance extension, so please give that version a try.

You can also try using this setting "python.analysis.enableSyncServer": true to see if that makes any difference- it forces the extension to handle one LSP message at a time (you need to restart VS Code once for that setting to take effect). If you can determine a procedure to reliably reproduce the issue, it would be greatly useful to the maintainers of this extension in the resolution process.

If none of that works, one user found that they could work around the issue for the time being is to reload the VS Code window with the Developer: Reload Window command in the command palette (note that this may require re-running cells).

For your reference and learning purposes, I found the above issue ticket by googling "github vscode issues jupyter crash "Chained file path undefined doesn't match cellFilePaths"".

starball
  • 20,030
  • 7
  • 43
  • 238
0

It is a known issue I faced as well. I tried downgrading with version 2023.7.40 but Pylance still crashed when adding/deleting cells.

Version v2023.7.30 solved the issue for me.

EDIT: After a couple of days, the issue came back and is still persistent. Looks like they haven't solved it yet, you can check the updating status here on the official github: https://github.com/microsoft/pylance-release/issues/4685

I'm currently using the v2023.6.30 release but I'm not sure it will solve the issue. I think the best option right now, is to keep an eye on the github issue and wait to get it fixed

Phoenix
  • 63
  • 7
0

Issue seems to have just been fixed as of 4 hours before posting. https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#2023851-30-August-2023-PreRelease

Go to your pylance extension in vscode and switch to pre-release version.

Jeff
  • 610
  • 4
  • 12