Skip to content

Cannot read property 'uri' of undefined when use jupyter interactive #1854

Closed

Description

Issue Type: Bug

Actual behavior

It will alert Cannot read property 'uri' of undefined when use jupyter interactive, and won't successfully activated. However, native jupyter works well.
I have tried reinstalling the extension and the vscode, but this problem still exists.
image

Environment data

Extension version: 2020.3.71659
VS Code version: 1.44.2
OS version: Windows_NT x64 10.0.18363

Logs

  • Output: No output for Python in the Output panel
  • Console
Error Python Extension: 2020-04-21 17:13:55: DataScience Error [TypeError: Cannot read property 'uri' of undefined	at s.get rootPath [as rootPath] (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:718209)	at _.getOwningResource (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:805130)	at _.getNotebookOptions (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:805692)	at _.startServer (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:776009)	at _.ensureServerAndNotebookImpl (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:775698)	at _.ensureServerAndNotebook (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:775342)	at _.ensureServerAndNotebook (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:806648)	at new _ (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:803080)	at Object.t.resolveInstance (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:93194)	at c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:92396	at Object.t.resolve (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:92663)	at c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:83747	at e._get (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:83513)	at e.get (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:60:82224)	at a.get (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:1166603)	at y.create (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:820979)	at y.getOrCreateActive (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:820390)	at r.addCode (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:729316)	at runMatchingCell (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:730236)	at runCell (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:75:727360)	at r.s.value (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:12849)	at m.runCell (c:\Users\ganxy\.vscode\extensions\ms-python.python-2020.3.71659\out\client\extension.js:1:733715)	at e._executeContributedCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:592:220)	at e._doExecuteCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:591:378)	at executeCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:591:284)	at y._executeConvertedCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:594:105)	at e._executeContributedCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:592:220)	at e.$executeContributedCommand (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:592:595)	at e._doInvokeHandler (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:683)	at e._invokeHandler (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:375)	at e._receiveRequest (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:751:14)	at e._receiveOneMessage (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:749:832)	at d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:34	at e.fire (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)	at v.fire (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)	at d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:919:744	at e.fire (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)	at v.fire (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)	at t.PersistentProtocol._receiveMessage (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:211:17)	at d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:208:155	at e.fire (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)	at p.acceptChunk (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:204:129)	at d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:203:483	at Socket.t (d:\Applications\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:212:565)	at Socket.emit (events.js:203:13)	at addChunk (_stream_readable.js:295:12)	at readableAddChunk (_stream_readable.js:276:11)	at Socket.Readable.push (_stream_readable.js:210:10)	at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)]

Activity

  1. IanMatthewHuff commented on Apr 21, 2020

    @IanMatthewHuff
    Member

    ganxy (@ganxy1028) quick question. Do you currently not have a workspace folder open? Due to the error that I see in the console log I believe that we might not be handling this case correctly.

  2. IanMatthewHuff commented on Apr 21, 2020

    @IanMatthewHuff
    Member

    Actually a bit more info might be helpful as well.

    1. How are you starting up the window? Just running a cell from that .py file that you have open?
    2. What is the full path to the file that you have open?

    My suspicion (you could try this out as a workaround) is that if you open up the folder that file is in as a workspace folder this will work.

  3. IanMatthewHuff commented on Apr 21, 2020

    @IanMatthewHuff
    Member

    Just for our team triage notes. It looks like it might be coming from here if the workspace folders had [undefined] which via the vscode api doesn't look possible.

    public get rootPath(): string | undefined {
            return Array.isArray(workspace.workspaceFolders) ? workspace.workspaceFolders[0].uri.fsPath : undefined;
        }
    
  4. ghost closed this as completedon Apr 27, 2020
  5. locked as resolved and limited conversation to collaborators on May 5, 2020
  6. unlocked this conversation on Nov 13, 2020
  7. locked as resolved and limited conversation to collaborators on May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions