Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'hasOwnProperty' of undefined #34

Open
1 of 4 tasks
jy1989 opened this issue Jan 30, 2024 · 32 comments
Open
1 of 4 tasks

TypeError: Cannot read property 'hasOwnProperty' of undefined #34

jy1989 opened this issue Jan 30, 2024 · 32 comments
Assignees
Labels
bug Something isn't working

Comments

@jy1989
Copy link

jy1989 commented Jan 30, 2024

Description

reference the docs https://gluestack.io/ui/docs/migration/native-base-to-gluestack-ui change the import from native-base to gluestack-ui/themed-native-base. it shows error

CodeSandbox/Snack link

No response

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

gluestack-ui Version

"@gluestack-ui/themed-native-base": "^0.1.101"

Platform

  • Android
  • Expo
  • iOS
  • Next

Other Platform

No response

Additional Information

image
the config is empty object

@jy1989 jy1989 added the bug Something isn't working label Jan 30, 2024
@akash3gtm
Copy link
Contributor

@jy1989
thank you for reporting the issue, we will look into it.

@akash3gtm akash3gtm assigned akash3gtm and unassigned makkarMeenu Jan 30, 2024
@jy1989
Copy link
Author

jy1989 commented Jan 30, 2024

@jy1989 thank you for reporting the issue, we will look into it.

@akash3gtm thank you

and is there anything I can do to avoid this error?

@akash3gtm
Copy link
Contributor

akash3gtm commented Jan 30, 2024

@jy1989 thank you for reporting the issue, we will look into it.

@akash3gtm thank you

and is there anything I can do to avoid this error?

The issue was coming from typescript.
It is fixed in the latest update, Please check and verify.

There should not be any other errors regarding typescript, but if you find some you can use // @ts-ignore just before the line giving you the ts-error. Please report the error here also.

@jy1989
Copy link
Author

jy1989 commented Jan 31, 2024

@jy1989 thank you for reporting the issue, we will look into it.

@akash3gtm thank you
and is there anything I can do to avoid this error?

The issue was coming from typescript. It is fixed in the latest update, Please check and verify.

There should not be any other errors regarding typescript, but if you find some you can use // @ts-ignore just before the line giving you the ts-error. Please report the error here also.

thank you for the reply

I checkout the latest version and try. there are some other errors. looks like same type of empty object error at different place.

So I tried to ignore these errors. and finally I found the nativebase style's component errors appear.

has this project been completed? to keep nothing change but import? for migrate from nativebase to gluestack-ui

@jy1989
Copy link
Author

jy1989 commented Jan 31, 2024

nativebase slow performance make me worried. and I try to find other library to replace it. and try my best to avoid modify the production app code.

@akash3gtm
Copy link
Contributor

Yes @jy1989, we made it in such a way that you won't need to change the code, and just by changing the import it will work.
Can you tell me which version of native-base you are using and which styling issues you are having.
It is currently in beta stage and we are working to release it as soon as possible with no errors (typescript included).

@akash3gtm
Copy link
Contributor

I am closing this issue now, but please do comment or open a new issue for any problem you face. :)

@jy1989
Copy link
Author

jy1989 commented Feb 1, 2024

image

here is the version I using. and my code @akash3gtm

image

the error:
01e3eee02552be40242b57883004d54

image

@jy1989
Copy link
Author

jy1989 commented Feb 1, 2024

I think no error if the component without any attribute

@akash3gtm
Copy link
Contributor

akash3gtm commented Feb 1, 2024

are you using aliasing to use @gluestack-ui/themed-native-base instead of native-base?
If not, you will need to use the NativeBaseProvider from @gluestack-ui/themed-native-base if you want to access the components of this library.
Please let me know regarding this, so I could assist you further.

@akash3gtm akash3gtm reopened this Feb 1, 2024
@jy1989
Copy link
Author

jy1989 commented Feb 2, 2024

@akash3gtm then I replace all the code to @gluestack-ui/themed-native-base
image

lots of render errors

image

image

@akash3gtm
Copy link
Contributor

can you let me know the version of @gluestack-style/react installed on your application?
and could you share the code in expo snack or the git of your project?

@jy1989
Copy link
Author

jy1989 commented Feb 2, 2024

image
@akash3gtm version 1.0.30

ok I will try to share my code later, thank you

@jy1989
Copy link
Author

jy1989 commented Feb 2, 2024

just share the code to you from github, please checkout and let me know . thank you @akash3gtm

https://github.com/jy1989/gluestack-ui-test

@akash3gtm
Copy link
Contributor

hi @jy1989 thank you for sharing, i will see what the issues are and update you on this.

@kylegwalsh
Copy link

Hey @akash3gtm, we talked on the other thread. I managed to replicate this in a snack and it appears to be due to the components option in the theme config. If I comment out the components styles, it seems to at least load without crashing:

https://snack.expo.dev/@kwalsh/gluestack-nativebase-issue

@akash3gtm
Copy link
Contributor

Hey @kylegwalsh
thank you for finding this, we will fix it as soon as possible @jy1989 .

@kylegwalsh
Copy link

@akash3gtm Whenever the bug is resolved, I can try the new version in my personal repository. It's more complex and will probably help identify any further issues (if any).

@akash3gtm
Copy link
Contributor

sure, @kylegwalsh
I will reply as soon as possible.
This issue is resolved, but we found some more of these issues, all are being resolved. Then we will release a new version.

@dhcmega
Copy link

dhcmega commented Feb 29, 2024

are you using aliasing to use @gluestack-ui/themed-native-base instead of native-base? If not, you will need to use the NativeBaseProvider from @gluestack-ui/themed-native-base if you want to access the components of this library. Please let me know regarding this, so I could assist you further.

Hi! I'm also getting the hasOwnProperty error. But this is making me rethink a few things. Do I have to remove native-base package? When I use useTheme I get the error that I need to use NativeBaseProvider but I was trying to use the one on the native-base package.
Is there a clear step by step guide to migrate? I'm struggling with this.
thanks!

@akash3gtm
Copy link
Contributor

Hi @dhcmega ,
we are working on the guide and the bugs reported.
we will inform as soon as we are done with both.

@sdfricke
Copy link

sdfricke commented May 9, 2024

Is this effort being abandoned? I'm not seeing much activity recently. Would be great to be able to use this to no longer rely on native-base in the meantime as I manually migrate.

@yushanwebdev
Copy link

any update @akash3gtm?

@pd185197
Copy link

Same issue here. @akash3gtm Is this repo going to be actively maintained in the future? We are trying to migrate to gluestack-ui-themed-native-base from nativebase but concerned whether this effort will be abandoned too like native base.

@frArdouin
Copy link

Same error here trying to switch from native-base to @gluestack-ui/themed-native-base. @akash3gtm Any update on this would be great.

@akash3gtm
Copy link
Contributor

Hi everyone, the product we were working on is almost finished.
We have bandwidth to support here.

I will soon start with this issue.

@ChrisCosentino
Copy link

Any workarounds for this? It is blocking me from migrating

@danim47c
Copy link

Same here, TypeError: Cannot read property 'hasOwnProperty' of undefined when migrating from native-base. Any update?

@MDSADABWASIM
Copy link

MDSADABWASIM commented Oct 23, 2024

still having the same issue on "@gluestack-ui/themed-native-base": "^0.1.108"

It's been 10 months, is there any hope of fixing this soon @akash3gtm?

Have you found any fix @jy1989?

@enzo-billis
Copy link

Same issue here. I will follow the issue, I hope a fix will be released soon. For now, we can't migrate from native-base to gluestack.

@hadassaplotnik
Copy link

hadassaplotnik commented Nov 26, 2024

same issue here. Now that native-base is causing error with react-native 0.76 I really need to migrate to gluestack but I can't get past these errors.

@MDSADABWASIM
Copy link

What's the issue you're getting with nativebase on v0.76 @hadassaplotnik, cause I'm also planning to switch to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests