Skip to content

TypeError: Cannot read properties of undefined (reading 'subscriptions') on extension deactivate (v1.30.0) #1557

@rssprivacy-commits

Description

@rssprivacy-commits

[Bug] TypeError: Cannot read properties of undefined (reading 'subscriptions') on extension deactivate (v1.30.0)

Extension: Python Environments (preview) ms-python.vscode-python-envs v1.30.0 (darwin-arm64)
VS Code: 1.121.x, macOS (Apple Silicon)

Summary

On extension-host shutdown / window close, the extension throws an unhandled TypeError while disposing its subscriptions. Appears related to the Cannot read properties of undefined class already reported in #223 / #427 / #958 / #1034.

Stack trace (captured in exthost.log)

[error] An error occurred when disposing the subscriptions for extension 'ms-python.vscode-python-envs':
[error] TypeError: Cannot read properties of undefined (reading 'subscriptions')
    at Object.te [as deactivate] (…/ms-python.vscode-python-envs-1.30.0-darwin-arm64/dist/extension.js:2:741102)
    at SP._deactivateAll (…/extensionHostProcess.js:534:11998)
    at SP.terminate (…/extensionHostProcess.js:534:12349)

Activated via API (activationEvent: 'api', root cause ms-python.vscode-pylance); reproduced across multiple windows on teardown.

Impact / workaround

Disabling / uninstalling the extension removes the crash (consistent with #427: "once the Python Environments extension was disabled, Python was resurrected").

Ask

Guard the deactivate/dispose path against an undefined context/subscriptions object (defensive null-check) so a preview component does not throw unhandled on teardown.

Note: a separate transient error toast with a (reading 'toString') message was also observed on tab creation in the same environment, but I could only capture the subscriptions variant in logs — I am NOT asserting the two share a root cause. This report is scoped to the logged subscriptions-on-deactivate crash.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions