Skip to content
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

Real life purpose of emitting errors about BEM module #74

Open
qfox opened this issue Mar 21, 2018 · 2 comments
Open

Real life purpose of emitting errors about BEM module #74

qfox opened this issue Mar 21, 2018 · 2 comments
Labels

Comments

@qfox
Copy link
Member

qfox commented Mar 21, 2018

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

webpack-bem-loader/index.js

Lines 139 to 144 in e9c1640

Object.keys(existsEntities).forEach(fileId => {
// check if entity has no tech to resolve
existsEntities[fileId] || errEntities[fileId].forEach(file => {
this.emitError(`BEM module not found: ${file.path}`);
});
});

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)
@Yeti-or
Copy link
Member

Yeti-or commented Mar 21, 2018

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

@Yeti-or Yeti-or added the bug label Mar 21, 2018
@Yeti-or
Copy link
Member

Yeti-or commented Mar 21, 2018

linked with: #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants