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.

exports.useColors is not a function

See original GitHub issue

Everything was working fine Friday. Had to reinstall fresh all my npm packages this morning, and I got this error in my webpack-dev-server

As I didn’t change anything to my package.json (and I’m not using directly debug) I suspect an update in the last days broke things. The only package I have using the most recent debug version is babel-core@6.17.0 (-> debug@2.4.5)

My webpack@1.13.2 and webpack-dev-server@1.16.2 use debug@2.2.0

I have no idea how to solve this issue right now, so if someone has clues I’d be happy to help

image

Extract of debug.js causing the problem :

image

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
TooTallNatecommented, Dec 21, 2016

@DaveGee For posterity, I’m curious as to what your webpack.config.js file looks like.

1reaction
DaveGeecommented, Dec 21, 2016

This is insane. Adding the lines about bower.json in the config of webpack solves the issue apparently, although I repeat : I do not use bower, and have no bower.json, nor .bower.json file anywhere in my own code

So I must add a config line about a tool I don’t use for my code to work. Anyone has an explanation about this ?

Thanks for your help

I’ll look more into this, as I won’t let my config files get messy with unrelated stuff. I think I prefer the shrinkwrap way

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack error : TypeError: mocha.useColors is not a function ...
Although it works when using mocha.color(true) , typescript will complain: error TS2339: Property 'color' does not exist on type 'Mocha'. .
Read more >
exports.useColors is not a function · Issue #384 · debug-js ...
Everything was working fine Friday. Had to reinstall fresh all my npm packages this morning, and I got this error in my webpack-dev-server....
Read more >
api documentation for mocha-webpack (v0.7.0)
color = function (type, str) { if (!exports.useColors) { return String(str); } return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; }...
Read more >
Documentation - mocha.js
esmDecorator] - Function invoked on esm module name right before importing it. By default will passthrough as is. * @returns {Promise}; * @example ......
Read more >
TypeError: require(...) is not a function in Node.js | bobbyhadz
Having cyclic dependencies (imports and exports between the same modules). typeerror require is not a function. Here is an example of how the...
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