nativewind / nativewind

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

Encountered issues when creating using the template, suspecting dependency conflicts #1190

Open lapse12 opened 2 weeks ago

lapse12 commented 2 weeks ago

Describe the bug I strictly followed the document for the project initialization, but... As shown in the figures, "Disconnected from Metro (1001: "Stream end encountered")."

Reproduction

I'd tried the following templates:

and another which is npx create-expo-app@latest(which in main branch)

image image

The issue seems to originate from the package "event-target-shim".

lapse12 commented 2 weeks ago

sry, I justI forgot to leave the URL.

this is the minimal reproduction: https://github.com/lapse12/reproduction-of-nativewind-bug

marklawlor commented 1 week ago

This does not look like a NativeWind issue (more to do with networking on your machine). Do the templates work as expected before you add NativeWind?

lapse12 commented 1 week ago

Yes, everything is normal except that Tailwind is not working.

marklawlor commented 1 week ago

I cloned your repro but I cannot reproduce the warnings you have reported.

However I can see on line 20 of app/(tabs)/index.ts you have added a className to <ThemedText />, so maybe your expecting that to work? The <ThemedText /> is a custom component that wraps <Text />, however it is not passing the className prop to <Text /> - hence it won't be styled.

If I pass the className prop correctly or just use <Text /> directly the styles work as expected.


As for your original issue, I'm still confused and feel that you need to explain the problem more clearly. "Everything is working" is a very broad term. I also don't know if "tailwind is not working" relates to your original issue about the warning, or simply the misuse of className prop.

What I need to concise information, basically instructions on how to reproduce the problem. For example

  1. Start with a template project. No warnings or problem.
  2. Follow the setup instructions at https://www.nativewind.dev/getting-started/expo-router
  3. Once you get to step 3 in the setup, if you run the project the problem occurs.