Skip to content
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

CSS is not generated. #5

Closed
seb-jean opened this issue Jun 28, 2023 · 5 comments
Closed

CSS is not generated. #5

seb-jean opened this issue Jun 28, 2023 · 5 comments

Comments

@seb-jean
Copy link
Contributor

seb-jean commented Jun 28, 2023

I have in template:

<link rel="stylesheet" href="{{ asset('styles/app.css') }}">

My source code is:
Capture5

But it just makes me:

@tailwind base;
@tailwind components;
@tailwind utilities;

I do have /var/tailwind/tailwind.built.css which is generated with the correct CSS.

Finally, when the contents of assets/styles/app.css is requested, the bundle swaps the contents of that file with the contents of var/tailwind/tailwind.built.css. Nice!

I think this sentence does not work for me.

@weaverryan
Copy link
Contributor

Hey @seb-jean!

Interesting and thanks for continuing to test this young code :). Let's see if we can debug. I agree with your conclusions - the content is not being "swapped" as advertised. This is the class that's responsible for doing the swapping: https://github.com/SymfonyCasts/tailwind-bundle/blob/main/src/AssetMapper/TailwindCssAssetCompiler.php

Is the supports() method being called? Try adding a dd() in supports(). Then do a bin/console cache:clear and bin/console debug:asset to hit that (the cache:clear is needed because assets are cached - so that caching will make it appear that supports() isn't being called even if it is).

So that's my main question: is supports() being called? And if so, is it returning true in the correct situations? Perhaps the paths being compared here - https://github.com/SymfonyCasts/tailwind-bundle/blob/main/src/AssetMapper/TailwindCssAssetCompiler.php#L28 - aren't matching on Windows. If so, I'd love to see what those paths look like when supports() is being called for assets/styles/app.css.

Thanks!

@seb-jean
Copy link
Contributor Author

seb-jean commented Jun 28, 2023

supports() is called but the condition is never true.

Here are the values of the variables of the supports function:

$asset->sourcePath equal C:\wamp64\www\my_project_sf\assets\styles\app.css
$this->tailwindBuilder->getInputCssPath() equal C:\wamp64\www\my_project_sf/assets/styles/app.css

@weaverryan
Copy link
Contributor

Yup - silly slashes 🙄 - thank you :). I've got the bug cornered in CI now on #6

@weaverryan
Copy link
Contributor

Ok, should all be fixed up now - try 0.1.2.

Thanks!

@seb-jean
Copy link
Contributor Author

It works.
Thanks Super Ryan 🦸‍♂️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants