webpack-bem-loader icon indicating copy to clipboard operation
webpack-bem-loader copied to clipboard

Real life purpose of emitting errors about BEM module

Open qfox opened this issue 7 years ago • 2 comments

For now we have code for emitting errors about non existent BEM modules.

https://github.com/bem/webpack-bem-loader/blob/e9c1640d6de597f42c76083e8f77ad3387f9ed78/index.js#L139-L144

In real projects it looks like infinite noise that does not help. At the same time emitError requires a special as an argument as passing there a string generates Critical errors inside Webpack itself.

ERROR in ./blocks/block-a/block-a.react.js
(Emitted value instead of an instance of Error) BEM module not found: ../block-b/block-b.css
 @ ./blocks/block-a/block-a.examples/index.react.js 21:26-59 21:71-104

Actually, there are 2 cases that we should fix here:

  • Create an error object instead of string to pass it in emitError
  • Reduce count of errors (to a zero if possible)

qfox avatar Mar 21 '18 14:03 qfox

I suppose this problem occurred after your project moved to webpack > 2 But it still valid one

Yeti-or avatar Mar 21 '18 14:03 Yeti-or

linked with: https://github.com/bem/webpack-bem-loader/issues/22

Yeti-or avatar Mar 21 '18 14:03 Yeti-or