Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Blank error when only webpackError property populated #100

Description

@cjhewett

If all the properties of the webpackError object are empty apart from webpackError property friendly-errors-webpack-plugin outputs nothing apart from the red word "Error".

I have the following webpackError outputted from the plugin: html-webpack-plugin:

{
  message: undefined,
  file: undefined,
  origin: '',
  name: undefined,
  severity: 0,
  webpackError: '  Error: Child compilation failed:\n' +
    "  Module not found: Error: Can't resolve '../foobar.html' in 'C:\\foobar':\n" +
    '  - compiler.js:79 \n' +
    '    [v1]/[html-webpack-plugin]/lib/compiler.js:79:16\n',
  originalStack: []
}

Actual Output:
Error:

Expected Output:
Error: Error: Child compilation failed Module not found: Error: Can't resolve '../foobar... etc.

As a userland fix I have added the following additionalTransformers to my config options:

additionalTransformers: [
  (webpackError) => {
    if (typeof webpackError.message === 'undefined') {
      webpackError.message = webpackError.webpackError;
    }
    return webpackError;
  },
],

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions