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

Created on 27 Feb 2018  路  4Comments  路  Source: nodejs/node

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.

duplicate windows

Most helpful comment

@addaleax Ah, yeah, I suppose once AppVeyor supports node v9.6 my tests can pass.

Thanks for addressing this!

All 4 comments

See https://github.com/nodejs/node/issues/14593, I鈥檓 pretty certain this is a duplicate of that. The fix (#18463) will be included the next v8.x release (https://github.com/nodejs/node/pull/18336, you can try the RC that鈥檚 linked there) and has been released in v9.6.0.

Thanks for all the work you鈥檝e put into this reproduction, though! It鈥檚 really appreciated.

I鈥檓 closing this as a duplicate, but feel free to ask if this should be re-opened or you have any questions about it.

Sorry, did not realize this issue was already filed.

Hopefully my reproduction library is of use.

Latest AppVeyor build is pending but you can see earlier builds (which are failing just because it's not compatible with v4).

@zenflow I don鈥檛 think there鈥檚 anything you鈥檇 need to do here, except wait for the next v8.x release. :)

@addaleax Ah, yeah, I suppose once AppVeyor supports node v9.6 my tests can pass.

Thanks for addressing this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seishun picture seishun  路  3Comments

srl295 picture srl295  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments

willnwhite picture willnwhite  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments