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

Blank error when only webpackError property populated #100

Open
ChrisHSandN opened this issue Nov 22, 2019 · 0 comments
Open

Blank error when only webpackError property populated #100

ChrisHSandN opened this issue Nov 22, 2019 · 0 comments

Comments

@ChrisHSandN
Copy link

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;
  },
],
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant