-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Does not work with tailwind jit mode #6251
Comments
This is more of an issue with how Tailwind's JIT works than with Parcel. We're working with the Tailwind team to resolve this. tailwindlabs/tailwindcss#3951 |
This should be fixed once #6299 is merged and Tailwind is updated to use the new |
@devongovett The |
Do you have a reproduction? I was using JIT mode with Parcel nightly just yesterday and it was working well for me. |
@devongovett This setup may look a bit weird because I've extracted it from the Phoenix project where I'm seeing the error, but it produces the error when you run |
@devongovett I took out a bunch of extra code and packages and stuff to simplify the reproduction. The new example is pared down to tailwind and sass: https://github.com/neurodynamic/tailwind_jit_fail_example Works fine with JIT mode off or if I comment out the |
Just a note that I'm experiencing the same issue here. A very simple Parcel 2/Tailwind set up in
@neurodynamic - did you ever find a solution to this? |
@m-w-d-d Nope, I ended up switching to esbuild. |
@devongovett with the most recent stable versions of Parcel 2 and Tailwind 3 this bug still exists. I debugged parcel build and this is what I found. Repo to reproduce: link.
config.hydrated.from = '';
config.hydrated.to = '';
let {
messages,
root
} = await postcss(plugins).process(program, config.hydrated);
NB: JIT is the only option in Tailwind 3, so no way to turn it off anymore, reasonable alternative until this is fixed is to use separate Tailwind build that produces CSS and just use that CSS directly in Parcel build. |
🐛 bug report
Parcel 2 works with tailwind in "regular" (non-jit) mode. I decided to try jit mode by adding
mode: "jit"
to mytailwind.config.js
file and suddenly started seeing this error:🎛 Configuration (.babelrc, package.json, cli command)
Running parcel with this command:
parcel watch js/app.ts css/*.sass --dist-dir ../priv/static
🤔 Expected Behavior
Compilation should succeed like it does when jit mode is off.
😯 Current Behavior
Parcel shows the error above, which makes it seem like it starts looking for an
app.css
file instead of theapp.sass
file that it was finding successfully when not using jit mode. That said, when I manually converted myapp.sass
file to a regular.css
file, it produced this error instead:Just like the
app.sass
file, running it on theapp.css
file worked fine as soon as I disabled jit mode.💁 Possible Solution
No idea
🔦 Context
Parcel 2 with Tailwind has been adding a huge amount of time to my compilation times (15-20 seconds on a very young project with very little front-end code). It sounds like it's not uncommon for tailwind to add to build times like this, so I was hoping to use jit mode to get build times back to a few hundred milliseconds.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: