-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR loads bundled CSS files in incorrect order #450
Comments
I created 8dbe834 but unfortunately this bug does not show up there :( . Going to create a fresh project and play around and see if I can recreate it. |
Hey @tracer99, I created https://github.com/matthewp/done-ssr-css-ordering-bug-example, which is a project that attempts to replicate this bug. Currently it is outputting them in the correct order. Would it be possible for you to see if you can break it? I don't know what is different about this project vs. yours. If we can get that one to break I can better figure out what the bug is. I've made you a collaborator so you can go in and do whatever you want. |
Will work on this next week. |
OK. First I tried my donejs-example app It loads 3 component styles first, then the main one, then the bundle one. So it's not even bundles, that's the problem, as the bundles are loaded after in this case. Trying to break the one you setup. |
@matthewp I've set things up with your example app and things also break now. |
@tracer99 I think you need to go here first and accept the invitation to be a collaborator: https://github.com/matthewp/done-ssr-css-ordering-bug-example/invitations |
@tracer99 let me know when you've gotten that pushed and i'll take a look. Thanks again! I love getting these kinds of bugs fixed. |
OK. Finally pushed my mods to https://github.com/matthewp/done-ssr-css-ordering-bug-example Note: I was not able to reproduce the issue exactly like we are experiencing in production. But I was able to get the CSS to load out of order. Hopefully the solution to this issue will fix ours. |
@matthewp any chance to look into this? |
I'll look at it today. |
Ok, when I build and run in production I get: a <link rel="stylesheet" href="/dist/bundles/bundle-order/index.css" asset-id="bundles/bundle-order/[email protected]#css">
<link rel="stylesheet" href="/dist/bundles/bundle-order/components/a.css" asset-id="bundles/bundle-order/components/[email protected]#css"> b <link rel="stylesheet" href="/dist/bundles/bundle-order/index.css" asset-id="bundles/bundle-order/[email protected]#css">
<link rel="stylesheet" href="/dist/bundles/bundle-order/components/b.css" asset-id="bundles/bundle-order/components/[email protected]#css"> Do you get something different? |
My output is completely different. I don't get linked less but included compiled css A
B
|
Those style tags should only appear in dev mode. Your'e seeing them in prod? That would be a totally different problem... I suspect you started the app without switching on production. |
Riiight. (hangs head in shame). OK. Back to trying to reproduce. |
Let me know if you get something different from #450 (comment) in prod mode. It's possible there's a race condition that might cause different results on different computers. |
Prod mode was the same as your output. Have to go back to trying to replicate. It's still an ongoing problem in our app so it's definitely an issue, I just have to figure out what is triggering it. |
Ok, sorry to hear this 😞. The place to probably poke around is probably this module. The stuff around |
If you have component less files, you expect to be able to override global CSS from the main less file using the same specificity. However, if you use bundles, the bundles may not be loaded in the way you expect. In our case, the main css file is loaded last. Meaning your component CSS has to have a higher specificity.
They don't seem to be in any specific order, other than the main css file being last every time. Not alphabetical. Not in order that the bundles are declared in package.json.
The text was updated successfully, but these errors were encountered: