Skip to content

Build errors are reported twice #1374

@jhiode

Description

@jhiode

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:

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:

handleError(error) {
this.getLogger().error(error);
}

The other place is the logging plugin for webpack:

compiler.hooks.done.tap('HopsLoggerPlugin', (stats) => {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions