nativewind: [ERROR] Use process(css).then(cb) to work with async plugins
This is the error I got after installing and configuring nativewind library with RN 0.72.3
error: App.js: /Users/***/Developer/***/App.js: Use process(css).then(cb) to work with async plugins
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 13
- Comments: 37 (2 by maintainers)
Links to this issue
Commits related to this issue
- ๐ fix(app): rollback to tailwindcss 3.3.2 because of postcss https://github.com/marklawlor/nativewind/issues/501 — committed to GuyAvraham/inner-child by deleted user a year ago
- ๐ fix(app): rollback to tailwindcss 3.3.2 because of postcss https://github.com/marklawlor/nativewind/issues/501 — committed to GuyAvraham/inner-child by deleted user a year ago
Update
^3.3.2to3.3.2Install
nativewindusing the following scripts.Change your tailwind version to
3.3.2in yourpackage.jsonand run yarn/npm installWill there be compatibility with 3.3.3 in the future ? whatโs causing this ?
๐ I think you dropped this. Thank you
it worked โฆ thanks
@reuel88 You need to pin the version, you still have a version range in your package.json
I believe this is related to a recent change in Tailwind
3.3.3to use async/wait in the PostCSS plugin.See PR: https://github.com/tailwindlabs/tailwindcss/pull/11548
Iโve never looked at the NativeWind code before, but upon an a quick browsing of the code. I have an idea that it might be necessary to match the async/wait approach in the NativeWind PostCSS plugin as it calls the TailwindCSS plugin internally.
See code reference: https://github.com/marklawlor/nativewind/blob/ece93a6db8730c01b1df9f39eb44ee590714fbd7/packages/nativewind/src/postcss/extract-styles.ts#L26
In particular, this appears to be the offending line of code
I would assume the entire call stack needs to be switched to async that calls
extraStycles.I would open a PR to fix this, but opening a code refactoring as my first PR isnโt always welcomed on a project and seems to me that NativeWind was last tested against Tailwind 3.2. So I would need to bump the dependency to
3.3.3and force everyone to upgrade.Let me know if this was helpful.
Been working on this for almost 24 hours. Thank you!!!
Duplicate of https://github.com/marklawlor/nativewind/issues/498
guys can you give me an example repository where it is using
expo-routerandnativewind. but the catch is it is really working. because I already followed the official guide and downgraded thetailwindto3.3.2. but it still has this error.this error is because of tailwind you need to change tailwind version from 3.3.3 to 3.3.2.All you need to do is remove node_modules folder and package-lock.json file and tailwind from package.json file and then
Working fine now. Thanks @chamaldesilva ๐ฏ
thanks men!
Finally, I was able to find the root cause. This is because of the tailwindcss library.