react-native-debugger icon indicating copy to clipboard operation
react-native-debugger copied to clipboard

Clear AsyncStorage option missing / not working

Open Robo-Rin opened this issue 6 years ago • 16 comments

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

Robo-Rin avatar Sep 26 '17 15:09 Robo-Rin

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.

jhen0409 avatar Sep 26 '17 16:09 jhen0409

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.

Robo-Rin avatar Sep 26 '17 16:09 Robo-Rin

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.

jhen0409 avatar Sep 27 '17 14:09 jhen0409

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

image

saggiyogesh avatar Jul 31 '18 12:07 saggiyogesh

Guys, any updates on this please.

saggiyogesh avatar Aug 09 '18 11:08 saggiyogesh

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

chrisbenincasa avatar Aug 13 '18 17:08 chrisbenincasa

Oh guys, it's really important

osdnk avatar Sep 01 '18 22:09 osdnk

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?

alubeck avatar Sep 27 '18 10:09 alubeck

The same issue, any resolution?

ValentinBlokhin avatar Nov 14 '18 13:11 ValentinBlokhin

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

Gregoirevda avatar Nov 23 '18 19:11 Gregoirevda

@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.

bartolkaruza avatar Dec 11 '18 08:12 bartolkaruza

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

Fischaela avatar Jan 30 '19 10:01 Fischaela

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 avatar Feb 14 '19 10:02 Gongreg

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

Gongreg avatar Feb 15 '19 09:02 Gongreg

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.

divyanshu013 avatar Nov 18 '19 07:11 divyanshu013

Still waiting on this. Any update?

sathwik77 avatar Sep 08 '22 08:09 sathwik77