Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

Bug: Order of ExtractTextPlugin #493

Open
mschipperheyn opened this issue Sep 7, 2017 · 4 comments
Open

Bug: Order of ExtractTextPlugin #493

mschipperheyn opened this issue Sep 7, 2017 · 4 comments

Comments

@mschipperheyn
Copy link

I spent quite a bit of time with a failing Dokku deploy which gave the error:

ERROR in Error: Child compilation failed: Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example

In my code I use style imports like so: import styles from './styles'

The problem was caused by the fact that ExtractTextPlugin ran after Uglify.

Changing to

  // For our production client we need to make sure we pass the required
  // configuration to ensure that the output is minimized/optimized.
  ifProdClient(
    () =>
      new webpack.LoaderOptionsPlugin({
        minimize: true,
      }),
  ),

  // For the production build of the client we need to extract the CSS into
  // CSS files.
  ifProdClient(
    () =>
      new ExtractTextPlugin({
        filename: '[name]-[contenthash].css',
        allChunks: true,
      }),
  ),

solved my issue. I'm assuming it has something to do with the css being used in-line as code. Prob got uglified before extraction or something like that.

@mschipperheyn
Copy link
Author

Hmm, getting it to work seems to have been a fluke. Back to the same error. This was not the solution

@verenea
Copy link

verenea commented Oct 13, 2017

Did you happen to come across a solution to your issue? I have been experiencing the same thing for nearly a day, have implemented every solution I can reasonably think of and have exhausted googles search result combinations of ETP/scss/Child compilation failed/etc...

@oyeanuj
Copy link
Contributor

oyeanuj commented Oct 29, 2017

@mschipperheyn @verenea Did any of you find a solution to this? I'm also seeing this error on adding some external CSS.

@verenea
Copy link

verenea commented Oct 30, 2017 via email

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

3 participants