gluestack-ui icon indicating copy to clipboard operation
gluestack-ui copied to clipboard

Issues with expo 51

Open AkermanGreg opened this issue 1 year ago • 7 comments

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

  • [X] Expo
  • [ ] React Native CLI
  • [ ] Next
  • [ ] Web
  • [ ] Android
  • [ ] iOS

Other Platform

No response

Additional Information

No response

AkermanGreg avatar May 14 '24 23:05 AkermanGreg

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

rajat693 avatar May 16 '24 07:05 rajat693

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

nathan-charles avatar May 21 '24 05:05 nathan-charles

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

ankit-tailor avatar May 23 '24 12:05 ankit-tailor

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.

ankit-tailor avatar May 27 '24 07:05 ankit-tailor

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 avatar Jun 06 '24 11:06 nelson-martins

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

nelson-martins avatar Jun 06 '24 14:06 nelson-martins

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

thanks!

nelson-martins avatar Jun 12 '24 10:06 nelson-martins