nativewind icon indicating copy to clipboard operation
nativewind copied to clipboard

ios error when using bun isolated installs

Open Alvi24 opened this issue 3 months ago • 5 comments

"nativewind": "^5.0.0-preview.2", "react-native-css": "^3.0.1",

Describe the bug [runtime not ready]: RangeError: Maximum call stack size exceeded (native stack depth) ERROR [runtime not ready]: Error: Non-js exception: AppRegistryBinding::startSurface failed. Global was not installed. i am getting this error when using bun isolated installs

Reproduction https://stackblitz.com/edit/nativewind-test-svfprxsx?file=.npmrc

Additional context

Image

Alvi24 avatar Oct 12 '25 16:10 Alvi24

@Alvi24 can you help me understand the purpose behind using Bun isolated installs? Your repro is using stackblitz and I believe our stackblitz only covers v4.1 of Nativewind so I can't be sure your project configuration is correct unless you create a repro via npx rn-new@next --nativewind --expo-router

danstepanov avatar Oct 13 '25 03:10 danstepanov

here is a reproductions link: https://github.com/Alvi24/nativewind-fix

Alvi24 avatar Oct 13 '25 18:10 Alvi24

@Alvi24 this repo is called "nativewind-fix", does this mean you have resolved your issue and your repro shows how you've done so?

danstepanov avatar Oct 15 '25 02:10 danstepanov

No i haven't resolved the problem, the word "fix" is that "it needs a fix"

Alvi24 avatar Oct 15 '25 05:10 Alvi24

same issue here

Mnigos avatar Oct 28 '25 17:10 Mnigos

I'm also getting this error, here are some commonalities with your setup:

  • same exact nativewind / react-native-css versions
  • also running a monorepo setup with yarn workspaces
  • I'm getting the error on android, I guess as a runtime error this is more likely..
  • disabling the globalClassNamePolyfill from react-native-css removes the call stack size error, but introduces others.

My suspicion is that the react-native-css native metro resolution overrides are causing an infinite loop in certain hoisted package scenarios (with Dimensions in this case):

https://github.com/nativewind/react-native-css/blob/008d479253365745acedef5a9602a7382f991597/src/components/index.cts#L146

huwcarwyn avatar Dec 12 '25 17:12 huwcarwyn

Ok after some more trial and error I have found that installing nativewind, react-native-css at the top level package.json ONLY will get you a working app.

huwcarwyn avatar Dec 13 '25 12:12 huwcarwyn