jhen0409 / react-native-debugger

The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools
MIT License
10.39k stars 811 forks source link

Clear AsyncStorage option missing / not working #148

Open Robo-Rin opened 7 years ago

Robo-Rin commented 7 years ago

I can no longer right click and clear AsyncStorage in 0.7.8. Whereas the option is there in 0.7.7.

Another thing that might help is 0.7.7 asked for firewall permission and then worked whereas 0.7.8 did not ask for any permission.

Edit: I just tried 0.7.7 again and it says the following:

image

This coincided with my upgrade to RN 0.48.4 from 0.48.3.

React Native Debugger app version: 0.7.8 React Native version: 0.48.4 Platform: Android Is real device of platform: Yes Operating System: Windows

jhen0409 commented 7 years ago

Are you using Haul bundler? I've filed an issue #141 (0.7.7 is wrong to show it). If no, I'll try it on Windows.

Robo-Rin commented 7 years ago

I'm using the default RN Packager for bundling, not Haul.

I should also mention that prior to this I was using 0.7.6 and RN 0.48.3 with no problems.

jhen0409 commented 7 years ago

I've tried RN 0.48.4 in the same environment as you, but I can't get the same problem.

test

I got these context menu items as expected and works fine.

You can try to type window.require in the console, it will cause the problem if it is not exists. If you can not find it, it's meant the require polyfill removed by something. But it's difficult to explain why downgrade to 0.7.6 will work.

saggiyogesh commented 6 years ago

Hi, Can't see the other options as mentioned in docs. Version: v0.7.20 RN version: 0.56.0

image

saggiyogesh commented 6 years ago

Guys, any updates on this please.

chrisbenincasa commented 6 years ago

Also not seeing the "Clear AsyncStorage" option anymore since upgrading React native

osdnk commented 6 years ago

Oh guys, it's really important

alubeck commented 6 years ago

Same here. But I'm used to clear my storage with console in the react native debugger via require('AsyncStorage').clear() ... now the console tells me that require is not defined ?! what?

$reactNative.AsyncStorage like mentioned here

https://github.com/jhen0409/react-native-debugger/blob/master/docs/debugger-integration.md#debugging-tips

also doesn't work ("$reactNative is not defined"). What? Is it related to my react-native upgrade to 0.57?

Anyone has a similar issue?

ValentinBlokhin commented 6 years ago

The same issue, any resolution?

Gregoirevda commented 6 years ago

To add the require polyfill, I tried adding getPolyfills in in a new metro.config.js file, like:

module.exports = {
   serializer: {
      getPolyfills: () => [
             'node_modules/requirejs/bin/r.js',
           /* list of all react native polyfills */
             'node_modules/react-native/Libraries/polyfills/Object.es6.js',
             'node_modules/react-native/Libraries/polyfills/console.js',
            'node_modules/react-native/Libraries/polyfills/error-guard.js',
             'node_modules/react-native/Libraries/polyfills/Number.es6.js',
             'node_modules/react-native/Libraries/polyfills/String.prototype.es6.js',
             'node_modules/react-native/Libraries/polyfills/Array.prototype.es6.js',
              'node_modules/react-native/Libraries/polyfills/Array.es6.js',
              'node_modules/react-native/Libraries/polyfills/Object.es7.js'
         ]
  }  
}

Adding a new getPolyfills, seems to overwrite the polyfills added by RN, so I had to add the list from (here)[https://github.com/facebook/react-native/blob/master/rn-get-polyfills.js]

But window.require is still undefined in the react-native-debugger console

bartolkaruza commented 5 years ago

@jhen0409 I think it only happens on newer RN versions, did you try to reproduce it with RN 0.57.x ? I haven't seen the option to clear the storage since the upgrade to that version.

Fischaela commented 5 years ago

This is still an issue for me. Using react-native-debugger 0.8.3 and react-native 0.57.8. Any updates on this?

Gongreg commented 5 years ago

Hey, make sure that you are using latest version. If the clear async storage still doesn't appear, you can at least use $reactNative.AsyncStorage.clear()

Just make sure that RnDebbuger.js process is selected in console

image

(Red button)

Gongreg commented 5 years ago

The logic for displaying the clear async storage is this:

Try to take AsyncStorage from all modules in the app, then check if if AsyncStorage.clear exists. If it exists display the button.

Make sure to use the latest version of React Native Debugger, it is 0.9.4

divyanshu013 commented 5 years ago

I'm able to replicate this on v0.10.4 running react native 0.59.10:

image

It seems like $reactNative is not available for some reason.

sathwik77 commented 2 years ago

Still waiting on this. Any update?