marklawlor / nativewind

React Native utility-first universal design system - powered by Tailwind CSS
https://nativewind.dev
MIT License
4.3k stars 233 forks source link

Nativewind in Expo Snack - resolving dependency error #879

Open jleonard99 opened 1 month ago

jleonard99 commented 1 month ago

Describe the bug A simple nativewind app written in expo snack editor "hangs" when loading the tailwindcss dependency.

To Reproduce

  1. Here is a working snack. Note that the nativewind CSS works on the right-hand window,
  2. Note the red bar on the bottom - "add dependency" (see first screen shot below.)
  3. When you add the dependency, snack hangs while trying to load tailwindcss 3.0.0.
  4. When you refresh the screen, the app no longer works and an error is thrown. (See second screen shot below).
  5. You can edit the package.json, removing the tailwindcss dependency. The app starts to work, but the Add dependency bar warning is shown.

Expected behavior I would expect that the tailwindcss dependency is loaded without errors so that I can continue to use nativewind for my snack.

Expo Snack https://snack.expo.dev/@jleonard99/cmsc475-example-tailwind-and-nativewind

Screen shots This shows the browser when the snack is first loaded. Note that the nativewind rendering works, but there is a dependency that needs loading at the bottom.

nativewind-issue-1

When you add the dependency, snack hangs while trying to load tailwindcss 3.0.0. When you refresh the screen you get this:

nativewind-issue-2

Note that the nativewind rendering is no longer showing.