react-universally icon indicating copy to clipboard operation
react-universally copied to clipboard

Bug: Order of ExtractTextPlugin

Open mschipperheyn opened this issue 7 years ago • 4 comments

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 avatar Sep 07 '17 08:09 mschipperheyn

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

mschipperheyn avatar Sep 07 '17 09:09 mschipperheyn

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...

verenea avatar Oct 13 '17 14:10 verenea

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

oyeanuj avatar Oct 29 '17 21:10 oyeanuj

I did... though it was a situation where I'd been grinding and trial-n-error testing for so long that I can't say for sure exactly what it was... I made like 3 potential fixes all at once and it built very late into the night, so claimed victory . If you have any way I can review some code we could compare ... or I can share a trimmed version of my project as well.

On Oct 29, 2017, at 4:52 PM, Anuj [email protected] wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

verenea avatar Oct 30 '17 00:10 verenea