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
@nuxtjs/tailwindcss: 5.2.0
nuxt: 2. it would be nice if the template suggested an easy way to see this
This was highly annoying to debug -- see below -- and is a major regression.
Prior to version 5.2.0, my tailwind config was loaded automatically. As of 5.2.0, it only gets loaded if I add to my nuxt config tailwindcss: { configPath: '~/tailwind.config.js' },
Now, here's the thing: when tailwind stops loading its config, it gives errors about completely unrelated things.
Upgrading to version 5.2.0 starts bringing up a new error:
Syntax Error: SyntaxError friendly-errors 12:40:53
(36:0) .../layouts/default.vue The `text-navy` class does not exist. If `text-navy` is a custom class, make sure it is defined within a `@layer` directive.
34 | body {
35 | @apply font-sans;
> 36 | @apply text-navy;
| ^
37 | @apply bg-white;
38 | }
Now, if you go looking for that error, you'll find stuff like this:
And then you'll spend hours hunting down why you need to worry about apply when you haven't used that at all.
In my example above, text-navy is indeed a custom class, but it's defined by my tailwind config. There's no indication that my config isn't being loaded anymore, just that crash above.
To diagnose this, I manually upgraded every sub-package of 5.2.0, such that my yarn.lock was at the exact delta that the branch to upgrade @nuxtjs/tailwindcss to 5.2.0 had (even @types!), except for this package. Then I upgraded 5.2.0. that confirmed it was this package specifically. Then I hunted through all the details of the release, formed a hunch, and tested it.
Version
@nuxtjs/tailwindcss: 5.2.0
nuxt: 2. it would be nice if the template suggested an easy way to see this
This was highly annoying to debug -- see below -- and is a major regression.
Prior to version 5.2.0, my tailwind config was loaded automatically. As of 5.2.0, it only gets loaded if I add to my nuxt config
tailwindcss: { configPath: '~/tailwind.config.js' },Here's the line that broke it: https://github.com/nuxt-community/tailwindcss-module/pull/483/files#diff-030fc083b2cbf5cf008cfc0c49bb4f1b8d97ac07f93a291d068d81b4d1416f70R32
Now, here's the thing: when tailwind stops loading its config, it gives errors about completely unrelated things.
Upgrading to version 5.2.0 starts bringing up a new error:
Now, if you go looking for that error, you'll find stuff like this:
[Utility class]is a custom class, make sure it is defined within a@layerdirective. tailwindlabs/tailwindcss#7055And then you'll spend hours hunting down why you need to worry about apply when you haven't used that at all.
In my example above, text-navy is indeed a custom class, but it's defined by my tailwind config. There's no indication that my config isn't being loaded anymore, just that crash above.
To diagnose this, I manually upgraded every sub-package of 5.2.0, such that my yarn.lock was at the exact delta that the branch to upgrade
@nuxtjs/tailwindcssto 5.2.0 had (even @types!), except for this package. Then I upgraded 5.2.0. that confirmed it was this package specifically. Then I hunted through all the details of the release, formed a hunch, and tested it.