nativewind / nativewind

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

[V4] error building in expo #995

Closed jrwpatterson closed 1 week ago

jrwpatterson commented 1 month ago

Describe the bug I'm getting a weird error on expo.

I'm getting the folowing error

 Executing dossy » Bundle React Native code and images
    Bundler cache is empty, rebuilding (this may take a minute)

❌  error: global.css: A jest worker process (pid=4068) was terminated by another process: signal=SIGTERM, exitCode=null. Operating system logs may contain more information on why this occurred.

if I try to build the code locally with Xcode I get this...

tailwindcss(ios) rebuilding... tailwindcss(ios) is taking a long time to build, please read https://tailwindcss.com/docs/content-configuration#pattern-recommendations to speed up your build time

It works locally when running and its a pretty fresh app. I tworks for android builds it just the IOs ones

"expo": "~51.0.26", "nativewind": "4.0.36", "tailwindcss": "3.4.2", "react-native": "0.74.5", "react-native-reanimated": "3.10.1",

007jedgar commented 4 weeks ago

Also getting the same error with eas build. Adding more context:

Executing appname » Bundle React Native code and images
    Bundler cache is empty, rebuilding (this may take a minute)

❌  (global.css:-1)

  1 | @tailwind base;
  2 | @tailwind components;
  3 | @tailwind utilities;
▸ ** ARCHIVE FAILED **

xcode logs

warning: Bundler cache is empty, rebuilding (this may take a minute)

tailwindcss(native) rebuilding... done

/Users/expo/workingdir/build/global.css:0:-1: error: Unable to resolve module /Users/expo/workingdir/build/node_modules/.cache/nativewind/global.css from /Users/expo/workingdir/build/global.css: 

Error: Unable to resolve module /Users/expo/workingdir/build/node_modules/.cache/nativewind/global.css from /Users/expo/workingdir/build/global.css: 

​

None of these files exist:

  * node_modules/.cache/nativewind/global.css(.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.mjs|.native.mjs|.mjs|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.scss|.native.scss|.scss|.ios.sass|.native.sass|.sass|.ios.css|.native.css|.css|.ios.css|.native.css|.css)

  * node_modules/.cache/nativewind/global.css/index(.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.mjs|.native.mjs|.mjs|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.scss|.native.scss|.scss|.ios.sass|.native.sass|.sass|.ios.css|.native.css|.css|.ios.css|.native.css|.css)
> 1 | @tailwind base;

    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  2 | @tailwind components;

  3 | @tailwind utilities;

  4 |

    at ModuleResolver.resolveDependency (/Users/expo/workingdir/build/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:112:15)
...

packages

"tailwindcss": "^3.4.10",
"nativewind": "4.0.1",
"react-native": "0.74.5",
"expo": "~51.0.28",
"react-native-css-interop": "^0.0.36",

relevant eas. (Added more memory to build)

"build" : {
  "production": {
      "env": {
        "NODE_OPTIONS": "--max-old-space-size=8192"
      }
    }
}
007jedgar commented 4 weeks ago

I got it to work after a few steps

I migrated to your versions:

"tailwindcss": "3.4.2",
"nativewind": "4.0.36",

deleted nodemodules and watchman

rm -rf node_modules .cache
watchman watch-del-all

updated the production key

"build": {
    "production": {
      "cache": {
        "key": "0.0.1" <---changed this
      },
}

ran prebuild clean and built it with success

npm install
npx expo prebuild --clean
eas build:configure 
eas build --platform ios 
robinsadeghpour commented 1 week ago

I have the same issue

danstepanov commented 1 week ago

We are closing all pre-v4.1 issues now that v4.1 is released. If the problem is still happening with the latest v4.1, please open a new issue and reference this one in the description.

thonyromes commented 1 week ago

I have the same issue

Have you been able to fix this?