-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Enabling JIT breaks sourcemaps in webpack + PostCSS project #5043
Comments
**here is a workaround until JIT and sourcemaps work ( it is breaking as of v2.2.7) **
and voila sourcemaps are working working with JIT and is blazing fast, styles sheets small as well :) |
@adamwathan FYI, sourcemaps still not working with JIT enabled in |
Same here. Source maps won't work in JIT mode. I just tried to make a new simple project with webpack and tailwind just to try it out. If I dont use JIT then the source maps works. If I use the mode JIT then the source maps wont work. I use Tailwind together with some CMS and some elements I cant add css classes to, so I have to use @apply to style those elements. I added some screenshots down below to show my project and how it looks in firefox dev tools. working source maps in firefox dev tools (JIT disabled) broken source maps in firefox dev tools (JIT enabled) error message in firefox dev tools (JIT enabled) |
Same here. |
Same here too, |
Adding any regular css rule or even a simple comment will generate sourcemaps correctly. <div class="with-sourcemap"></div>
<div class="with-another-sourcemap"></div>
<div class="no-sourcemap-here"></div> .with-sourcemap {
background-color: red;
@apply h-4 w-4 bg-green-500;
}
.with-another-sourcemap {
/* sourcemap will work here too */
@apply h-4 w-4 bg-red-500;
}
.no-sourcemap-here {
@apply h-4 w-4 bg-black;
} |
Source maps are also not working properly in 3.0.19.
The generated
Using Chrome DevTools all the Tailwind CSS rules show as |
What version of Tailwind CSS are you using?
2.2.6
What build tool (or framework if it abstracts the build tool) are you using?
webpack 5.46.0, postcss 8.3.6
What version of Node.js are you using?
14.17.0
What browser are you using?
Chrome
What operating system are you using?
Ubuntu
Reproduction repository
⠀
Describe your issue
When using Tailwind's JIT option for processing PostCSS in the webpack project, source maps are not being shown in the Chrome DevTools (but still generated in the output CSS file). The value of
devtool
option in the webpack config doesn't matter, the result is the same.With config like this:
Source maps don't get processed:

When disabling the JIT option:
Source maps are being processed properly, and the original file is shown in Chrome DevTools:

I'll bootstrap a repro repo if a more thorough investigation is needed.
The text was updated successfully, but these errors were encountered: