-
Notifications
You must be signed in to change notification settings - Fork 512
Unexpected: "ERROR in <blah> doesn't export content" #42
Comments
webpack/webpack#589 fixes this simple case, but we're still having issues with a slightly more complicated version. I'll post back here as I know more. |
Updating title to reflect that we actually see this error in non-watch mode as well. We have a little hack that seems to fix the issue, but I'm not 100% sure it's the "right" fix. |
The original issue posted here said that the output wasn't affected, but it actually does seem to be affected some percentage of the time, which I think increases the severity of the bug. After some debugging, I made a simple change that seems to fix the issue for us (the error messages go away, and it's been weeks since we had any corrupted output). I'm not entirely sure that the fix is correct -- there might be a better way to accomplish what I did, but I'm hoping someone more familiar with the code than me will take a quick look and be able to tell one way or the other. Any help/guidance on this would be much appreciated. Commit: roblg@413f55b |
hmm ok I get the issue... If a module is in multiple chunks it is built multiple times in parallel (propably with different intents (one want to extract it, the other not)... |
Got this issue, too. Hope to know if this will be fixed soon. Thx! |
Seems here is the same problem. |
I had difficulty applying @roblg's patch to the current codebase. With some tinkering, I was able to kind of sort of get it to work, but it broke hot reload. Looking a little further into it, it seems like the problem is that the loader declares that its results are cacheable, and then the plugin mutates the results from the loader. When I commented out the two lines in loader that look like this:
everything seemed to work fine, including hot reload. I'm not sure if that will cause any other problems, but it seems relatively safe to me. I'll make a PR. |
…h problems when a module is used in multiple places.
Any updates or work-around for this bug? I had to disable the extract-text plugin for the time being in development (watch) mode and add some conditionals to the application, but I'm afraid bad things might happen in production only since I use a different set-up for the development mode :( |
@rosenfeld we ended up following @aickin's advice and making the plugin output non-cacheable. He had a clever workaround to extend ExtractTextPlugin to fix the behavior -- no funky build-time step needed:
(borrowed from: https://github.com/aickin/react-server/blob/master/packages/react-server-cli/src/NonCachingExtractTextLoader.js; no idea if that link will work forever) |
I tried commenting the cacheable line before commenting in this thread and could confirm it worked, but on the other side it got much slower to update the output when the source changes, so I'm not sure whether it's better to disable caching for that plugin or to disable the plugin in watch mode... :( |
@roblg, I'm curious. How do you combine this loader with other loaders? The documentation talks about using the extract method and inform the other loaders (style, css and sass in my case). I don't know how to combine this loader class with other loaders... |
Nevermind, got it to work already. |
I'm experiencing this issue with |
I also see this issue in our - admittedly rather large - codebase. To rule out as much as possible (in terms of other dependencies), I set out to create a more minimalist test case project. I was able to quickly reproduce the issue using the code found at https://github.com/siebertm/extract-text-webpack-loader-issue-42-testcase. As @nighca already said, the issue seems to have something to do with the sync vs async require. In my test codebase, I'd like to help out more but I simply don't understand what and how the loader does what it does... |
+1, require.ensure problem? |
Here's a proposed fix following @aickin's suggestion that allows an weird though, the build is failing in Node 0.12 both in the CI and on my laptop, but it's failing on master too. |
I was having same issue (latest webpack and extract-text-plugin), the workaround to disable cache did not work for me. Making this change in .../node_modules/extract-text-webpack-plugin/index.js did the trick
issue in my case was that it was trying to recompile when shouldextract was false and wasExtracted was true Also it looks like in my case, aside from having a named entry including same css as an async chunk, this issue was only happening for me when my webpack config had two instances of |
what's about PR merging? |
From webpack-contrib#42 (comment) . This has already been fixed in Webpack 2+
Is anyone still experiencing this with |
@kostasmanionis I was still experiencing it when I ran rimraf (yarn clean). Now it is gone - after adding this line to .yarnclean
|
When running
./node_modules/webpack/bin/webpack.js --watch
, an error shows up in the terminal after changing a CSS file ("ERROR in doesn't export content"), and the webpack compilation seems to run twice.The high-level setup is as follows: two entry points, one (
OneEntry.js
) does a synchronous require ofDep.js
, and the other (TwoEntry.js
) does a require.ensure ofDep.js
.Dep.js
requiresDep.css
. ChangingDep.css
while running with--watch
triggers the error message.The final output doesn't seem to be affected (at least in my simple example here), but it's still a scary message. I started to step through it with node-debug, but didn't get much farther than figuring out where the error was coming from -- line 156 of
extract-text-webpack-plugin/index.js
. I'll probably look at it at little further tomorrow.My webpack.config.js:
OneEntry.js
TwoEntry.js
Dep.js
Dep.css
Console output:
The text was updated successfully, but these errors were encountered: