Skip to content

Language server does not respect VS Code/system HTTP proxy for Prisma CLI binary downloads #1984

Description

@chirag127

Problem

The Prisma VS Code extension shells out to the Prisma CLI and also downloads the language server binary on first run. In corporate environments behind an authenticated HTTPS proxy, both operations silently time out or fail with an opaque network error. The extension does not forward the proxy configuration that VS Code itself reads from http.proxy / http.proxyAuthorization settings.

Steps to Reproduce

  1. Configure a corporate proxy in VS Code:
    "http.proxy": "http://proxy.corp.example.com:8080",
    "http.proxyStrictSSL": false
  2. Open a workspace that has a prisma/schema.prisma file.
  3. On first activation, the language server binary download hangs — no progress bar, no error shown.
  4. If binary is pre-cached: running Prisma: Generate from the command palette times out when the CLI tries to fetch the engine binaries.

Expected Behaviour

The extension should detect the proxy from vscode.workspace.getConfiguration('http').get('proxy') (and fall back to HTTPS_PROXY / HTTP_PROXY env vars) and pass it to:

  • The node-fetch / download client used for fetching the language server binary.
  • The environment of the spawned Prisma CLI process (HTTPS_PROXY env var).

Proposed Change

When spawning the CLI or making HTTP requests:

const proxyUrl = vscode.workspace.getConfiguration('http').get<string>('proxy')
  ?? process.env.HTTPS_PROXY
  ?? process.env.HTTP_PROXY;

const childEnv = { ...process.env };
if (proxyUrl) childEnv['HTTPS_PROXY'] = proxyUrl;

child_process.spawn('prisma', ['generate'], { env: childEnv });

Environment

  • OS: Windows 11 Enterprise 10.0.26200 (corporate network with mandatory proxy)
  • Node.js: 20.x
  • VS Code: 1.89+
  • Extension: prisma.prisma latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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