-
Notifications
You must be signed in to change notification settings - Fork 108
Sorting paths messes up tailwind #74
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
Comments
Weird. This should only affect the order that the files are copied. I’ll check this tonight. |
@miharekar Would you mind posting the generated HTML for that page here so I can use the same thing to test? |
@brenogazzola it's this repo https://github.com/miharekar/decent-visualizer It's fairly standard so you should be able to easily reproduce. But if it's too much, I can do it, sure. |
OK, so the new version seems to load I got to that by grepping for the v2.2.19 tailwind css version that was loaded 😅 which makes sense because and they're both named |
It's a bit unexpected that you have a EDIT: Nevermind, I'm checking your repository, and there's no Tailwind file there. |
But that's exactly what the tailwindcss-rails gem does:
|
Yeah, it was my bad, sorry. I figured out what was confusing me. There seem to be multiple problems here. Problem 1 If you had a single version ( Problem 2 What's happening is that there are two files with the logical path in the paths array. That is |
Re problem 1: One is build, the other is from the gem, what's the third one? What would fix it in this case would be to first load app paths, and then gems. Which could be achieved with sort. But if you want to |
Solution for 1: @miharekar You might want to check why your project has two different versions of Tailwind installed. Solution for 2: @dhh This is a problem we talked about before. Two assets with the same logical path, and Propshaft silently keeping only the first one it finds. We need to log a warning, or raise an error. And in this specific case, where the user has no control over the names of the files, we need to teach Propshaft to ignore the |
@miharekar Keeping only the app's version of the file might still cause a problem if the developer needs the file that was inside the gem too (probably more common with gems that have image assets) |
I only use what gem generates. Did you maybe mean |
I've linked an issue I opened in the tailwind gem. It seems that the file in the assets folder does not match the version tailwind actually uses (which comes from |
Ever since #71 or its fix in #72 the order of paths gets scrambled and that messes up tailwind for me.
I don't do any
config.assets
modification at all so this should all be default. I have the latest version of all the other gems.Propshaft::LoadPath#initialize
propshaft 0.6.1 logic:
propshaft 0.6.3 logic:
So in the new version the tailwind compilation doesn't seem to work but I don't know enough about it to dive deeper.
Doing
@paths = dedup(paths).sort.reverse
fixes it, so this is definitely the issue, but that's not a proper fix 😅I think the dedup method should respect the order of paths passed in.
The text was updated successfully, but these errors were encountered: