-
Notifications
You must be signed in to change notification settings - Fork 930
-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does 'debug' cache the DEBUG environment variable somewhere? Getting no output after changing namespace and DEBUG env var. #901
Comments
Having a similar issue here, but just to help you, maybe try running |
No idea, this seems like an environment issue to be honest. |
I've been bitten by this the other day too. Turns out, |
@algernon that's a detail of the browser version. I believe OP is using the node side of things. |
Same issue with Remix today, process.env shows the correct expected DEBUG string, but |
Are/were you using regex in your code somewhere? possibly passing it into debug? When I had However, at that point, the universe decided I was done, as uncommenting it did not reintroduce the issue and no matter what I do now I can't reproduce it again, I've rolled everything back to exactly as it was when I had the problem and it's just gone 🤷 |
I am using 'debug' with TypeScript in an Electron project like so:
in my shell (zsh) I set the
DEBUG
env var like soexport DEBUG=foo
and then started running my application. Everything worked fine. Eventually, I changed the namespace fromfoo
tobar
and now no matter what I do, I cannot get any output. I tried resettingDEBUG
, I restarted my shell and set the environment variable again withexport DEBUG=bar
, I tried using the [cross-env]{https://www.npmjs.com/package/cross-env} to set it like so:but nothing ever shows up.
I tried
and the
console.log
output is indeed:DEBUG bar
.The only way I can get it to work now is by doing:
The moment I change
const log = debug('bar');
back toconst log = debug('foo');
, I get output messages for thefoo
namespace no matter what's in the DEBUG env var.Any idea what might be happening here?
The text was updated successfully, but these errors were encountered: