paperspace-node icon indicating copy to clipboard operation
paperspace-node copied to clipboard

NODE_ENV mismatch

Open cvalenzuela opened this issue 7 years ago • 2 comments

Hello there!

I'm developing an app with electron and I have my own custom environment variables. Running any request to the paperspace api with my own NODE_ENV creates an error in line 14 of client.js:

var nodeEnv = processEnv.NODE_ENV;
var config = configInfo[nodeEnv || 'production'];

Throwing this:

TypeError: Cannot read property 'host' of undefined

because I don't have a custom .host variable in my environment variable.

I got to pass the error by specifying production always:

var config = configInfo['production'];

I'm not sure if this is the intended behavior. If not, I can submit a PR to fix this

cvalenzuela avatar Apr 04 '18 21:04 cvalenzuela

We left this in for local debugging during development, but didn't think about it conflicting with other developers. Sorry about that. A better fix might be to check for a list of explicit values, e.g. 'production', and default to 'production' if we don't recognize the NODE_ENV value.

What value are you setting NODE_ENV to?

sanfilip avatar Apr 04 '18 22:04 sanfilip

I'm setting NODE_ENV to development because I have another process that uses that to minify and preprocess files.

cvalenzuela avatar Apr 04 '18 22:04 cvalenzuela