-
Notifications
You must be signed in to change notification settings - Fork 513
Add ignoreOrder option to avoid the OrderUndefinedError #166
Add ignoreOrder option to avoid the OrderUndefinedError #166
Conversation
Would be fantastic to get this merged. |
We really need this! :) |
Hey @sokra, I hate having to mention people on github issues, but we need to get some attention somehow. I've noticed that there are quite a lot of pull requests open (like this one), and most are very useful things to have in this module. I understand that you and other contributors are very busy, but this is an essential package for webpack users. Is there any way you could have a look into this? Or at least give some feedback? Thank you ;) |
Thanks @MicheleBertoli, this works perfectly for us - using |
This PR got the compilation to succeed for me. Here’s the command I use to install it:
|
I'm hitting this as well. I think this is a fairly meaningful problem – even in cases where there are no conflicts (i.e. no undefined behavior), this still causes problems with getting builds to succeed. |
This PR has solved the problem I had with React CSS Modules when building the production dist: Steps to solve it:
|
Is this still a problem with the latest beta edit: It's still a problem, |
I have rebased @MicheleBertoli's |
This should fix the strange failure of 'webpack --watch' with the following message: Order in extracted chunk undefined There are upstream pull requests in webpack which work to fix this, but for now we just work around the issue. webpack-contrib/extract-text-webpack-plugin#166
This should fix the strange failure of 'webpack --watch' with the following message: Order in extracted chunk undefined There are upstream pull requests in webpack which work to fix this, but for now we just work around the issue. webpack-contrib/extract-text-webpack-plugin#166 Closes #5288
👍 not sure what's going on here but also busted with CSS modules, is no one using it in production? |
This especially makes sense with CSS modules because CSS modules doesn't guarantee any deterministic ordering anyway |
why does this happens? i don't have circular dependencies |
@felixsanz - We need to get a stable 2.0 out. This has been added to the 2.1 milestone, which we will begin working on as soon as 2.0 is @latest For reference, if you need something addressed you will have more success directing the request to either myself or bebraw. Tobias, Sean & Kees are focused on webpack/webpack anything under webpack-contrib is handled by a separate group now so we can address issues faster and bump up the frequency of releases for all plugins / loaders. You can ping me on here, or if it's pressing on twitter (same name) which will ding my cell |
I'm still kinda confused, does literally no one use css modules in production? Or is there a workaround? I ironically ditched browserify just for the nicer CSS modules implementation, but it's broken for production haha. |
It works for some cases I guess. At least I have used it in production. It stopped working as soon as I introduced variables aka values. |
I have a temporary fork on npm under my namespace with this code. We've been running with that for the last several months. |
https://www.npmjs.com/package/@taion/extract-text-webpack-plugin in case I was unclear |
@tj I don't know what's changed since I last had this issue, but since upgrading to webpack 2.2.0, version 2.0.0-beta.5 of this plugin has been working fine for me in production. :/ |
@sunny-g interesting! I'll try upgrading soon and see how that goes |
I updated to the latest versions today and it's not fixed. Its tagged to be fixed on 2.1 @tj, if you want a nice workaround, try this:
@import "./layout.css";
@import "./typography.css";
@import "./elements.css";
@import "./animations.css"; This way, this is the only place where you import those files, so the order will be always the same. (No more issue).
@value typography: "../../styles/composition/index.css";
@value elements: "../../styles/composition/index.css";
.whatever {
composes: defaultLink from typography;
composes: defaultInput from elements;
} What happened is that you import your files only 1 time in your code, and then you create values for those classes. And with the postcss plugin you can compose those shared classes from the value (not directly from the file). Of course, since you are importing those values from @value shared_classes: "../../styles/composition/index.css";
.whatever {
composes: defaultLink from shared_classes;
composes: defaultInput from shared_classes;
} But i prefer duplicating them because when i compose the classes it's more clear the original location of the shared class. (and it doesn't alter the size, it just doesn't matter) Hope it helps. |
664e78c
to
76a171d
Compare
Included in |
Hi @bebraw |
@MatteoGabriele Correct. |
@bebraw any chance of a workaround for webpack1 "owners"? I need to put a project in production today and I don't know how to fix it. thanks! :) |
@MatteoGabriele Probably the fastest way for you would be to fork the webpack 1 branch and patch that. If you have time, PRing that fix could be nice so you could consume an official version after that. |
@bebraw I was thinking about that one. is this the only line i need to change? extract-text-webpack-plugin/index.js Line 312 in 10781f5
|
@MatteoGabriele Correct. The fix itself is very simple. 👍 |
@bebraw Thanks man! I'm going to do it! |
- Use temp fix documented here: webpack-contrib/extract-text-webpack-plugin#166 (comment) - Above fix is included in webpack 2.0 and will be resolved in upgrade
Any progress on this?! This is quite annoying! |
@delijah I don't think we'll see a webpack 1 specific release. Maybe the fastest way to get the fix there is to branch the webpack 1 version and apply the fix there although migrating to webpack 2 is the preferred way. |
But this is not really fixed in webpack 2, isn't it? |
@delijah Please open a separate issue if the PR didn't work for you. |
By using version 2.1.0 of extract-text-webpack-plugin, webpack 2.4.1 and the config options
it seems to work for me now. Sorry for the confusion, i have got lost in dependencies and the sheer amount of pullrequests and issues regarding this issue. Thank you soooo much for providing a solution for this!!! |
Slight twist on @delijah ... This works for me:
Per: https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/master/index.js#L112-L124 PR: To update this error text, here: Versions in use:
|
@bebraw @MicheleBertoli - Can you explain how facebook/create-react-app/pull/2285 allows both css modules and regular css in the same project. To fix cssmodule errors we'd like to add |
Following the discussions in:
/issues/80
/pull/81
css-modules/css-modules#12
This commit adds an
ignoreOrder
option to avoid the OrderUndefinedError when the order doesn't matter.