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

Warning: TypeError: Cannot read property 'RealmProvider' of undefined #6874

Open
zainlinux1989 opened this issue Aug 31, 2024 · 1 comment
Open

Comments

@zainlinux1989
Copy link

How frequently does the bug occur?

Always

Description

I am using realm 11.10.2 and @realm/react 0.5.2 version but my app always crashes in debug mode.
i am using following code

import {createRealmContext, RealmProvider} from '@realm/react'

export class FoodSchema extends Realm.Object<FoodSchema> {
  id: string = ''
  name: string = ''
  foodGroup: string = ''
  calories: number = 0
  fat: number = 0
  count: number = 0
  timestamp: string = ''

  static schema = {
    name: SchemaName.Food,
    primaryKey: 'id',
    properties: {
      id: 'string',
      name: 'string',
      foodGroup: 'string',
      calories: 'double',
      fat: 'double',
      count: 'int',
      timestamp: 'string',
    },
  }
}
 return (
    <RealmProvider schema={[FoodSchema]}>
      <View style={{flex: 1, backgroundColor: 'green'}} />
    </RealmProvider>
  )

Stacktrace & log output

Warning: SyntaxError: JSON Parse error: Unexpected character: p, js engine: hermes  
ERROR  Warning: TypeError: Cannot read property 'RealmProvider' of undefined

This error is located at:
    in AppAndroid (created by RNRedux)
    in PersistGate (created by RNRedux)
    in Provider (created by RNRedux)
    in ThemeProvider (created by RNRedux)
    in $97d95f6660b1bb14$export$9f8ac96af4b1b2ae (created by NativeBaseProvider)
    in ToastProvider (created by NativeBaseProvider)
    in PortalProvider (created by NativeBaseProvider)
    in HybridProvider (created by NativeBaseProvider)
    in ResponsiveQueryProvider (created by NativeBaseProvider)
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by NativeBaseProvider)
    in NativeBaseConfigProviderProvider (created by NativeBaseProvider)
    in NativeBaseProvider (created by RNRedux)
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by RNRedux)
    in RNRedux
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in MeFit(RootComponent), js engine: hermes

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

11.10.2

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 14

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

Copy link

sync-by-unito bot commented Aug 31, 2024

➤ PM Bot commented:

Jira ticket: RJS-2898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant