NativeScript/tailwind

Tailwind 3 Release

pandabuilt opened this issue · 8 comments

I see that tailwind 3 was released and we upgraded our nx repo with it. Works flawlessly with web, however, because you are depending on version 2 it causes a few issues.

I see that dependabot has a branch, but when I used the branch tag it caused more errors.

https://github.com/NativeScript/tailwind/tree/dependabot/npm_and_yarn/tailwindcss-3.0.22

The actual error I get is from post-css loader Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
But almost certainly positive it's a mismatched object somewhere since Tailwind 3 is different.
TypeError: Cannot read properties of undefined (reading 'config') at getTailwindConfig

Merged in #112 - still need to go through and update the readme/docs.

Will release as an rc most likely because it needs the alpha version of core (8.2.0-alpha.*).

Released 2.0.0-rc.1 - updated readme with latest instructions.

Interesting - I had a tailwind. config file in the root of NX repo - now it's saying it's unfound. Does it only look for it in the apps folder? IF so I can require/reference it.

@rigor789 Sorry, forgot to tag you. Also, thanks for the speedy merge!

Only looks for in the app folder - but you can re-export the root one easily:

const sharedConfig = require('../../tailwind.config')

module.exports = {
  ...sharedConfig,
  // overrides here
}

@rigor789 The classes stopped working for me now. I use the above code

Keep in mind - I did update @tailwind screens to @tailwind variants but utilities also don't work and that did not change.

Anything quick you can think of off the top of your head?

Make sure your content is correct in the config, must be relative to the config path.

ie.

const sharedConfig = require('../../tailwind.config')

module.exports = {
  ...sharedConfig,
  content: [
    './app/**/*.{css,xml,html,vue,svelte,ts,tsx}'
  ],
}

For some reason, it was removed from package.json in the app - didn't realize it. Got it.

Thank you!