-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
This is my intent (choose one)
- I want to report a bug
- I want to request a feature or change
- I want to provide or change a feature
The problem
Running hops build with a build error results in the error message being printed twice to the console.
Proposed solution
It should be sufficient to print the message only once.
The reason is that we are having two callbacks for the compilation:
hops/packages/webpack/lib/utils/compiler-fork.js
Lines 58 to 62 in 665eb0f
| if (watch) { | |
| compiler.watch(watchOptions, callback); | |
| } else { | |
| compiler.run(callback); | |
| } |
This will reject the build promise and that results in the handleError hook getting called.
| .catch(this.handleError), |
And in that hook we just log the error:
hops/packages/info/logger/mixin.core.js
Lines 56 to 58 in 665eb0f
| handleError(error) { | |
| this.getLogger().error(error); | |
| } |
The other place is the logging plugin for webpack:
hops/packages/webpack/lib/plugins/log.js
Line 68 in 665eb0f
| compiler.hooks.done.tap('HopsLoggerPlugin', (stats) => { |