Skip to content

Not working with dotenv #446

@hyperh

Description

@hyperh

I can't seem to get debug working with dotenv. It works fine when I set the env var from outside of .env like so:

package.json

"dev": "NODE_ENV=development DEBUG=*,apicache nodemon",
npm run dev

server.js

import 'babel-polyfill';
import makeDebug from 'debug';
import dotenv from 'dotenv';

const env = dotenv.config();
console.log(process.env.DEBUG); // outputs *,apicache correctly
const debug = makeDebug('brainfm:server/index');
debug('.env', env); // Doesn't show anything

.env

DEBUG =*,apicache

Metadata

Metadata

Assignees

Labels

discussionThis issue is requesting comments and discussionwont-fixThis is not a feature or proposal that will be incorporated, or a bug that won't be addressed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions