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

Fix undefined error when debugging modules #589

Merged
merged 1 commit into from
Dec 18, 2016

Conversation

xoob
Copy link
Contributor

@xoob xoob commented Dec 16, 2016

Fixes an issue where launching a debug session with modules results in the error "Cannot read property 'cwd' of undefined".

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Module",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config.python.pythonPath}",
            "module": "module.name",
            "cwd": "${workspaceRoot}",
            "console": "integratedTerminal",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit"
            ]
        }
   ]
}
messageService.ts:126 TypeError: Cannot read property 'cwd' of undefined
    at PythonDebugger.launchRequest (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/out/client/debugger/Main.js:152:89)
    at PythonDebugger.DebugSession.dispatchRequest (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/node_modules/vscode-debugadapter/lib/debugSession.js:361:22)
    at PythonDebugger.ProtocolServer._handleData (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
    at Socket.<anonymous> (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20): Error: TypeError: Cannot read property 'cwd' of undefined
    at PythonDebugger.launchRequest (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/out/client/debugger/Main.js:152:89)
    at PythonDebugger.DebugSession.dispatchRequest (/Users/alex/.vscode/extensions/donjayamanne.python-0.5.5/node_modules/vscode-debugadapter/lib/debugSession.js:361:22)
...

Fixes an issue where launching a debug session with modules results in the error "Cannot read property 'cwd' of undefined"
@DonJayamanne DonJayamanne merged commit 39d2062 into DonJayamanne:master Dec 18, 2016
DonJayamanne added a commit that referenced this pull request Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants