Skip to content

process.env.DEBUG truthy check causes wrong server path when other extensions set DEBUG variable #701

@jollycoder

Description

@jollycoder

Description

AHK++ fails to start when another VS Code extension sets DEBUG environment variable to a non-empty string (e.g. OpenAI Codex sets DEBUG=release).
The extension resolves the server path using:

process.env.DEBUG ? "out" : "dist"

Since any non-empty string is truthy in JavaScript, AHK++ picks out/server.js instead of dist/server.js, which doesn't exist, causing the server to crash on startup.

Reproduction steps

Steps to reproduce the behavior:

  1. Install OpenAI Codex extension
  2. Restart VS Code
  3. AHK++ server fails to start with Cannot find module '...server/out/server.js'

Fix suggestion

Replace the truthy check with a strict comparison:

process.env.DEBUG === "true" ? "out" : "dist"

Metadata

Metadata

Labels

bugsomething isn't working

Projects

Status
To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions