zalmoxisus / remote-redux-devtools

Redux DevTools remotely.
http://zalmoxisus.github.io/monitoring/
MIT License
1.81k stars 139 forks source link

JSON value '1' of type NSNumber cannot be converted to NSString #51

Closed tarex closed 8 years ago

tarex commented 8 years ago

having this problem with react-native version 0.36.0, i'm using latest remote-redux-devtools

screen shot 2016-10-29 at 7 31 14 pm

used https://github.com/jhen0409/remote-redux-devtools-on-debugger/ also

zalmoxisus commented 8 years ago

It's hard to tell what's going on here. Is it happening when you start the app or after some actions are dispatched?

Could you try if it works with remote-redux-devtools@0.5.0?

tarex commented 8 years ago

it's working now, I had also a problem with my store configuration. thanks 👍

dasblitz commented 8 years ago

Edit: Managed to solve this issue doing to following:

install react native debugger: https://github.com/jhen0409/react-native-debugger#installation

using the configure store setup used in this project: https://github.com/jhen0409/react-native-boilerplate

deleting all node-modules and run npm install

Original post:

@tarex I'm running into the exact same problem, usingremote-redux-devtools with remote-redux-devtools-on-debugger my configureStore is posted below, could you clarify what steps you took to fix it? Or where I should be looking?

import { Platform } from 'react-native';
import { createStore, applyMiddleware, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import devTools from 'remote-redux-devtools';

import rootReducer from '../reducers';

// Middleware
const sagaMiddleware = createSagaMiddleware();

/**
* Sets up our store
*
* @return {Object} the redux store object containing the state of our app
*/
export default function configureStore() {
    const enhancer = compose(
        applyMiddleware(sagaMiddleware),
        devTools({
            name: Platform.OS,
            hostname: 'localhost',
            port: 8084
        })
    );

    const store = {
        ...createStore(rootReducer, enhancer),
        runSaga: sagaMiddleware.run
    };

    // enable hot module replacement on the redux store (module.hot is only available on develop)
    if (module.hot) {
        module.hot.accept(() => {
            const nextRootReducer = require('../reducers/index').default;
            store.replaceReducers(nextRootReducer);
        });
    }

    return store;
}
zalmoxisus commented 8 years ago

@dasblitz thanks for the details. Maybe if @tarex managed to use it with remote-redux-devtools-on-debugger, we could add some details to help others when experiencing such troubles?

dasblitz commented 8 years ago

I think that would be great. I'll check tomorrow if deleting and reinstalling all node modules wasn't already enough to fix it.

joshfttb commented 8 years ago

I'm having the same problem when starting the app. I'd also be curious for details as to how the others fixed it. Reinstalling node_modules did not work for me.

joshfttb commented 8 years ago

I solved this the same way @dasblitz did, but that's not a fix, it's switching to a different tool.

carloscuatin commented 8 years ago

I'm having the same problem when starting the app

darrencamp commented 8 years ago

This is also happening for me, coincidentally, after updating to MacOS Sierra (10.12.1) and xCode 8.1

react-native: 0.35.0 remote-redux-devtools: 0.5.0 remote-redux-devtools-on-debugger: 0.6.3

zalmoxisus commented 8 years ago

Please try to downgrade to remote-redux-devtools@0.5.0 as in 0.5.1 we updated socketcluster which could cause the issue.

Unfortunately, there's not enough information to see from where it comes.

dasblitz commented 8 years ago

@zalmoxisus downgrading to 0.5.0 fixes it for me. The full list of errors when using 0.5.1 is below and happening right after refreshing the app with 'cmd + r'. (If you dismiss the errors, app and logging works, until you refresh again).

schermafbeelding 2016-11-01 om 09 47 19

tarex commented 8 years ago

sorry for the late response, yes just used 0.5.0 but the error message is showing with the latest version. I have checked with the newly created react-native app.

zalmoxisus commented 8 years ago

Thanks for the details. Related to https://github.com/SocketCluster/socketcluster-client/issues/67

zalmoxisus commented 8 years ago

Could someone try to install socketcluster-client@5.0.0 to see if it's specific to 5.0.15 patch or to 5.0.0? It would help to identify where the problem appeared.

The only change from our side is updating socketcluster.

dasblitz commented 8 years ago

@zalmoxisus yes, I've just installed "remote-redux-devtools": "0.5.1" with socketcluster-client@5.0.0 no errors :)

edit: no errors until socketcluster-client@5.0.14

jondubois commented 8 years ago

@dasblitz Can you pinpoint the specific version (or approximate) which breaks it between socketcluster-client 5.0.0 and 5.0.15? That way I can narrow down possible issues. I can't test it on my machine.

You could git clone https://github.com/SocketCluster/socketcluster-client and checkout different versions until it breaks: https://github.com/SocketCluster/socketcluster-client/commits/master

Thanks for confirming that 5.0.0 works.

dasblitz commented 8 years ago

@jondubois yes, I tried to make it clear in my previous comment. I get no errors using socketcluster-client@5.0.0 and socketcluster-client@5.0.14 (havent tried everything in between), it breaks using socketcluster-client@5.0.15

zalmoxisus commented 8 years ago

@dasblitz, you confused remote-redux-devtools and socketcluster-client, or it was a typo and you meant 5.0.0 instead of 0.5.0?

dasblitz commented 8 years ago

Ah my bad it was a typo, updated the version numbers in my comment above.

edit: to be more specific, I tested remote-redux-devtools@0.5.1 with the above mentioned versions of socketcluster-client. (Sorry for all the confusion)

zalmoxisus commented 8 years ago

I replicated that. The issue was introduced in the latest patch of socketcluster-client. Till a new version is released, just stick to remote-redux-devtools@0.5.0.

TGPSKI commented 8 years ago

remote-redux-devtools@0.5.0 works for me! I spent a few days thinking I was going insane tracking this guy down. Just found this thread minutes ago and fixed really fast.

mmmurf commented 8 years ago

remote-redux-devtools@0.5.0 does not work for me. I'd be happy to go through detailed troubleshooting steps as this utility is extremely valuable for me.

Uncommenting devTools() causes the error to occur:

function configureStore(initialState) {
  const enhancer = compose(
    applyMiddleware(thunk),
    //devTools()
  );
  return createStore(reducer, initialState, enhancer);
}

const store = configureStore()
zalmoxisus commented 8 years ago

@mmmurf the same error as in the first post?

mmmurf commented 8 years ago

@zalmoxisus yep

jondubois commented 8 years ago

@zalmoxisus Ok, after resting on RN on iOS, I can confirm that it was the latest version of SC which was causing the problem. I published the fix to npm in socketcluster-client v5.0.17.

zalmoxisus commented 8 years ago

@jondubois thanks a lot for investigating and fixing this!

remote-redux-devtools@0.5.2 with the updated socketcluster-client is on npm.

mmmurf commented 8 years ago

Yes thanks, @jondubois ... works for me now as well.