Skip to content
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

[V4] - Issues Upgrading to 4.0.36 - Tailwind CLI, works in 4.0.1 #836

Open
theblondealex opened this issue Mar 1, 2024 · 6 comments
Open

Comments

@theblondealex
Copy link

theblondealex commented Mar 1, 2024

Describe the bug
Error running TailwindCSS CLI, please run the CLI manually to see the error.

I have a project running perfectly on ^4.0.1 however need to upgrade to the latest version of nativewind 4.0.36, after running into issues after installing 4.0.36, and forking the repo and running the expo example in the monorepo with the same error I am unsure how to fix.

In order to test if it was my repo that was the issue or nativewind I created a blank expo router project as follows

  1. npx create-expo-app --template
  2. clicking Navigation (TypeScript) template to generate a blank expo router project
  3. npm run start to verify the project is working in expo go (success)
  4. Follow the steps in here as I have done before when installing 4.0.1 only this time in the install nativewind step I try
    npm install nativewind@^4.0.36 react-native-reanimated tailwindcss
  5. npm run start gives this error

error stack in CLI is

Error running TailwindCSS CLI, please run the CLI manually to see the error.
Command used:  node C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\node_modules\tailwindcss\lib\cli.js --input "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\global.css" --output "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\node_modules\.cache\nativewind\global.css.ios.css" --watch

To Reproduce
Steps to reproduce the behavior:

  1. clone the git repo below
  2. npm/npx expo install the dependancies
  3. npm run start

Expected behavior
Tailwind should run fine, if I downgrade to nativwind 4.0.1 it no has issues and compiles the tailwind completely fine, however of course want to be on latest version to use it best

Expo Snack
this repo can be cLoned here or the steps above to make a fresh project from expo router

Additional context
I have troubleshooted my project by removing nativewind and it worked, adding nativewind 4.0.1 and it works fine but not on 4.0.36,

I have also trouble shooted the tailwind itself via the recommended steps in the guide and by doing this

node "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\node_modules\tailwindcss\lib\cli.js" --input "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\global.css" --output "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\node_modules\.cache\nativewind\global.css.ios.css" --watch

which outputs

PS C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue> node "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\node_modules\tailwindcss\lib\cli.js" --input "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\global.css" --output "C:\Users\Alexander\OneDrive\Documents\APPS\CODING\GIT CLONES\4.0.36-tailwind-CLI-Issue\testingissue\node_modules\.cache\nativewind\global.css.ios.css" --watch
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

Rebuilding...

Done in 223ms.

indicating that the tailwind compilation is not having an error itself

I am out of ideas and have best tried to debug it including forking the nativewind lib and using it locally but to no avail, let me know if theres any questions or assistance I can give in debugging this, for now I'll continue in 4.0.1 :)

@theblondealex
Copy link
Author

I am aware of issue #813 however none of those solutions were able to solve it, and since 4.0.1 is able to work I am thinking the issue is with 4.0.36 breaking :)

@benrbowers
Copy link

benrbowers commented Mar 15, 2024

Having this issue and working version for me seems to be 4.0.14

Literally the bare minimum version for me because this is the version gap-x starts working.

And lo and behold, there seems to be a commit that deals with the tailwind cli between 14 and 15. I tried passing 'npx tailwindcss' and 'yarn tailwindcss' to the cliCommand option in the metro.config, but nothing seems to work for version
4.0.15 and onward.

After 4.0.15, expo start simply gets stuck at tailwindcss(native) rebuilding... then tells me to run the command manually.

@benrbowers
Copy link

After changing to 4.0.15 but reverting 6bb5648, the problem still persists. Not really sure what the problem is at this point, but the solution remains to be to use 4.0.14

@benrbowers
Copy link

benrbowers commented Apr 6, 2024

Got 4.0.36 working! The problem was yarn. I got away with using yarn v1 for far too long, but this seems to be the straw that broke the camel's back. Upgrading to yarn v4 seems to have fixed everything. nativewind@4.0.36 now working on my intel mac with the iOS simulator, as well as on Ubuntu with android simulator.

Upgraded yarn like this:

> npx npkill
> yarn set version berry
> yarn install

@sshodges
Copy link

I was using nvm and running the below command fixed it for me:

sudo ln -s $(which node) /usr/local/bin/node

@GabeConsalter
Copy link
Contributor

I was using nvm and running the below command fixed it for me:

sudo ln -s $(which node) /usr/local/bin/node

This works, thanks @sshodges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants