Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

NODE_ENV mismatch #11

Open
cvalenzuela opened this issue Apr 4, 2018 · 2 comments
Open

NODE_ENV mismatch #11

cvalenzuela opened this issue Apr 4, 2018 · 2 comments

Comments

@cvalenzuela
Copy link

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

@sanfilip
Copy link
Contributor

sanfilip commented Apr 4, 2018

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?

@cvalenzuela
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants