infinitered / reactotron-react-native

Reactotron's react-native client.
MIT License
110 stars 27 forks source link

Undefined is not a function - reactotron startup #1043

Open raybelisle opened 2 years ago

raybelisle commented 2 years ago

I just installed reactotron and when I start up my app with the desktop client or the flipper client, I get this message immediately and no connection is established. Simulator Screen Shot - iPhone 11 - 2022-10-06 at 10 54 31

Environment is the latest version of the tools. In package.json: "reactotron-react-native": "^5.0.3", "reactotron-redux": "^3.1.3",

And my reactotron config when trying with flipper is:

`import Reactotron from 'reactotron-react-native'; import ReactotronFlipper from 'reactotron-react-native/dist/flipper'; import AsyncStorage from 'react-native';

Reactotron.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from react-native or @react-native-community/async-storage depending on where you get it from .configure({ // name: 'Jobble QA Dev', createSocket: (path) => new ReactotronFlipper(path), // ... }) // controls connection & communication settings .useReactNative() // add all built-in react native plugins .connect(); // let's connect! `

If I try to connect to the desktop client I have used this instead:

`import Reactotron from 'reactotron-react-native'; import ReactotronFlipper from 'reactotron-react-native/dist/flipper'; import AsyncStorage from 'react-native';

Reactotron.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from react-native or @react-native-community/async-storage depending on where you get it from .configure() // controls connection & communication settings .useReactNative() // add all built-in react native plugins .connect(); // let's connect! ` and the following in App.js does output the message Reactotron Configured

if (__DEV__) { import('./ReactotronConfig').then(() => console.log('Reactotron Configured')); }

Any ideas on what to try here?

labmorales commented 1 year ago

Getting the same error here.

labmorales commented 1 year ago

Mine was getting this error when we migrated form AsyncStorage to MMKV. The solution for us was to just remove the setAsyncStorageHandler method:

Going from this:

Reactotron.setAsyncStorageHandler(asyncStorage)
    .configure()
    .useReactNative()
    .use(reactotronRedux());

To this

Reactotron
    .configure()
    .useReactNative()
    .use(reactotronRedux());