You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While those are reasonable options, resolving paths relative to the configuration file that declares them (rather than unstable process cwd) is a fairly common pattern, so the current behaviour is a little unexpected, at least when the Tailwind function is provided an explicit configuration path (of course, when passing an object, using the cwd is acceptable).
The text was updated successfully, but these errors were encountered:
Seems to be duplicate with #6516, addressed in part by #6516 (comment). However the default behaviour is still surprising to me - I understand it may be difficult / impossible to change it outside of a major, but perhaps the error message should be updated to clearly point out the problem? For example:
The 'content' configuration matched 17 files but none of them contained any CSS classes. Adding
'relative: true' to your configuration would have matched 132 classes. Did you forget to define it?
See this link for more details: https://tailwindcss.com/docs/content-configuration#using-relative-paths
Hey! So the default behavior is something we want to (and are likely to) change for v4 later this year. I definitely can see how it's surprising which is why we want to make it the default. Lots of ideas and stuff are up in the air for v4 but I'm pretty sure that change is settled.
Alongside that we've had a plan for a while on a command that does these kinds of additional checks for you but "out-of-band" because of the potential performance impact.
What version of Tailwind CSS are you using?
3.2.4
What build tool (or framework if it abstracts the build tool) are you using?
postcss (as a JS API; I don't use the CLI)
What version of Node.js are you using?
n/a
What browser are you using?
n/a
What operating system are you using?
n/a
Describe your issue
Take the following code; as you can see, Tailwind fails to see that the files referenced in
tailwind.config.js
exist:https://runkit.com/arcanis/63e022537347590008b0d296
It works if I use
process.chdir
to move inside thewebsite
folder, or if I use__dirname
instead of./
:https://runkit.com/arcanis/63e023088424060008aa8a47
While those are reasonable options, resolving paths relative to the configuration file that declares them (rather than unstable process cwd) is a fairly common pattern, so the current behaviour is a little unexpected, at least when the Tailwind function is provided an explicit configuration path (of course, when passing an object, using the cwd is acceptable).
The text was updated successfully, but these errors were encountered: