gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.45k stars 116 forks source link

Issues with expo 51 #2157

Open AkermanGreg opened 4 months ago

AkermanGreg commented 4 months ago

Description

Crashes entire app

CodeSandbox/Snack link

No response

Steps to reproduce

  1. Start a new project with Expo 50 and gluestack
  2. Update to expo 51
  3. Try to load app
  4. See error ERROR Error: You cannot use tokens without wrapping the component with StyledProvider. Please wrap the component with a StyledProvider and pass theme config.

gluestack-ui Version

latest

Platform

Other Platform

No response

Additional Information

No response

rajat693 commented 4 months ago

please share more information this is not enough, to debug the issue

nathan-charles commented 4 months ago

I got this same error with expo 51 using @gluestack-ui/themed when I tried to use @gluestack-style/babel-plugin-styled-resolver plugin. I noticed using certain tags caused the app to crash for example using gap caused a crash then removing it was fine. For now I just removed the babel plugin

ankit-tailor commented 4 months ago

Hey @nathan-charles, Thanks for reporting the issue. We'll fix it.

ankit-tailor commented 4 months ago

Hey @nathan-charles @AkermanGreg, Babel plugin can't find the config file; it defaults to searching in the project's root directory. Export the Gluestack config from the project's root.

import { config as defaultConfig } from "@gluestack-ui/config";

export const config = defaultConfig;

Let me know if that works.

nelson-martins commented 3 months ago

Hello, we have the same problem and we tried the previous suggestion - it works on the android simulator but not while running it in Expo in a real Android. The error persists.

thanks,

nelson-martins commented 3 months ago

And now I realize that even in the android simulator the error persists. It reappears somehow randomly...

nelson-martins commented 3 months ago

Hi @AkermanGreg, have you managed to solve this issue?

thanks!