Skip to content

Not working with dotenv #446

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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