Skip to content

fix: don't die if process exists but process.env doesn't#284

Merged
alexdima merged 1 commit into
microsoft:mainfrom
akx:env-fix
Jun 13, 2026
Merged

fix: don't die if process exists but process.env doesn't#284
alexdima merged 1 commit into
microsoft:mainfrom
akx:env-fix

Conversation

@akx

@akx akx commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the DebugFlags.InDebugMode detection so the library doesn’t throw at module-evaluation time in environments where a process shim exists but process.env is missing/undefined (as reported by Shiki users).

Changes:

  • Make access to process.env['VSCODE_TEXTMATE_DEBUG'] null-safe via optional chaining to avoid Cannot read properties of undefined errors.
Show a summary per file
File Description
src/debug.ts Uses optional chaining when reading process.env to prevent runtime crashes when env is absent.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@alexdima alexdima enabled auto-merge (squash) June 13, 2026 18:49
@alexdima alexdima merged commit 82c7762 into microsoft:main Jun 13, 2026
3 checks passed
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.

4 participants