Skip to content

The value of process.env.foo can sometimes be observed to be undefined after being assigned the value of '' #19048

@zenflow

Description

@zenflow

The value of process.env.foo can sometimes be observed to be undefined after being assigned the value of ''

Please see zenflow/node-bug-windows-process-dot-env for a full reproduction, with execution set up on Travis CI and AppVeyor CI.

Subsystem: unknown
Local Version: v8.9.4
Local Platform: ver says version 10.0.16299.248, 64-bit
AppVeyor Versions: v6, v8, v9
AppVeyor Platform: ver says version 10.0.16299.248, 64-bit

Full issue description (copied from the reproduction repo)

After being assigned the value of '', the value of process.env.foo can sometimes be observed to be undefined.

This seems to only happen in Windows environments.

It also happens rather unpredictibly (yet consistently). There are two tests in the tests dir: symptom.js and no-symptom.js. symptom.js will show the symptom on Windows and no-symptom.js will not. But look how similar the two tests are, and how the difference would not be expected to change the outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions