question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why is `enable()` not a function?

See original GitHub issue

I’m using TypeScript and I have the following:

let debug = require('debug')('mytest');
debug.enable();

Which causes a JS error stating that debug.enable is not a function. However this works:

debug.enabled = true;

What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Qix-commented, Dec 19, 2019

Yep, is there a problem with that? Docker containers are meant to be destroyed and re-created.

1reaction
Qix-commented, Dec 18, 2019

What makes you think loggers have an .enable() method?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery seems to have an enable function, but not a disable ...
jQuery does not support an enable() method out of the box (and the disable HTML attribute does not exist either, but that might...
Read more >
Why is `enable()` not a function? · Issue #733 · debug ... - GitHub
I'm using TypeScript and I have the following: let debug = require('debug')('mytest'); debug.enable(); Which causes a JS error stating that ...
Read more >
Moralis.Web3.enable() is not a function (after update)
I get this error on browser console: Moralis.Web3.enable() is not a function . Here is my code: $(document).ready(async function(){ web3 = await ...
Read more >
How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >
window.ethereum.enable is not a function - General - MetaMask
When I connect the wallet, the website told me: window.ethereum.enable is not a function.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found