Dotenv: ERROR in ./~/dotenv/lib/main.js

Created on 6 Sep 2017  路  5Comments  路  Source: motdotla/dotenv

I am getting this funky error running on version:
"dotenv": "^4.0.0",

ERROR in ./~/dotenv/lib/main.js Module not found: Error: Can't resolve 'fs' in '/home/datasmurfen/Code/project/node_modules/dotenv/lib' @ ./~/dotenv/lib/main.js 3:9-22

All 5 comments

are you using it client side?

I run it locally on my machine - if I get your question correct.
I was able to supress the warning message by adding this to my package.json:

node: {
      fs: 'empty',
      child_process: 'empty',
    }

But some how the app render just blank page then.

@datasmurfen sorry let me clarify my question. Are you using it with something like webpack or browserify? Then you might wanna checkout some possible solutions in https://github.com/motdotla/dotenv/issues/172

Yes I am using webpack.

Yeah we are not planning on supporting client side environment variables. https://github.com/motdotla/dotenv/issues/172 should have some solutions for your issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ycmjason picture ycmjason  路  4Comments

mattcdavis1 picture mattcdavis1  路  5Comments

Quocnamit picture Quocnamit  路  3Comments

Vandivier picture Vandivier  路  3Comments

goldbergyoni picture goldbergyoni  路  3Comments