flipper-plugin-relay-devtools icon indicating copy to clipboard operation
flipper-plugin-relay-devtools copied to clipboard

Plugin appearing with empty dropdown, unable to load store

Open CoreyLoose opened this issue 4 years ago • 11 comments

I'm really excited about getting this to work, and feel like I've gotten most of it set up, but I must be missing something.

  1. I've got flipper + react native working together, and I can use the React DevTools plugin as expected

  2. I've added your plugin to my project, and have the following code running

if (__DEV__) {
  import("react-native-flipper-relay-devtools").then((m) => m.addPlugin());
}
  1. When I load up the Relay DevTools plugin in flipper I see the following Screen Shot 2021-07-30 at 10 05 39 AM

Any idea what's going on there? If you've got a hunch I'm happy to dig in and fix something if need-be.

Thanks!

CoreyLoose avatar Jul 30 '21 16:07 CoreyLoose

What version of relay are you using? I've seen this happen when the plugin can't connect to the relay store for some reason. Also is it on iOS or Android?

janicduplessis avatar Aug 03 '21 15:08 janicduplessis

Have the same issue too, the flipper logs report [Relay DevTools] Connected but the dropdown is empty.

Running Relay 12, Flipper 0.108.0 and [email protected] targeting an iOS Simulator. React Devtools and other plugins appear to be working correctly.

It appears to be connecting as expected, when starting the plugin I get The server is listening on port 8098. Waiting for connection and then end up with the same screen as @CoreyLoose (same version, empty dropdown, nothing in Network either).

I'm aso getting the same result debugging on a physical Android device.

Any tips for debugging the connection?

levibuzolic avatar Oct 04 '21 11:10 levibuzolic

Found a solution, strangely using a dynamic import doesn't work for the relay devtools in my app, even though the promise resolves and I can see there's an object exposed with an addPlugin() function, it doesn't seem to initialise properly.

Swapping the dynamic import out for a require works:

if (__DEV__) {
  require('react-native-flipper-relay-devtools').addPlugin();
}

levibuzolic avatar Oct 04 '21 21:10 levibuzolic

Same here:

"react-native": "0.64.2",
"react-relay": "^11.0.2",
"react-native-flipper": "^0.114.1",
"react-native-flipper-relay-devtools": "^1.0.3",

image

Swapping the dynamic import out for a require works:

if (__DEV__) {
  require('react-native-flipper-relay-devtools').addPlugin();
}

Doesn't work for me

akinncar avatar Oct 12 '21 17:10 akinncar

@akinncar are you getting The server is listening on port 8098. Waiting for connection in the flipper logs?

levibuzolic avatar Oct 12 '21 22:10 levibuzolic

Thanks for reporting the issue, I'll see if I can reproduce and find a fix in the next few days!

janicduplessis avatar Oct 13 '21 00:10 janicduplessis

@akinncar are you getting The server is listening on port 8098. Waiting for connection in the flipper logs?

not really

Thanks for reporting the issue, I'll see if I can reproduce and find a fix in the next few days!

Thanks, let me know if you want more information or if I can help with something more.

akinncar avatar Oct 13 '21 12:10 akinncar

Hi experts, new to react-native world. I tried to follow the readme and have very thing setup. But when launching the app, getting this error message from the flipper debugger console: bundle.js:3843 Failed to start device plugin 'flipper-plugin-relay-devtools': TypeError: Cannot read property 'sendCommand' of undefined. Device is connected as I can use the React DevTools. Any hints? Thanks

waynezhang1995 avatar Oct 14 '21 21:10 waynezhang1995

I had the same issues in my app. I published a new version of the plugin that fixes the TypeError: Cannot read property 'sendCommand' of undefined. I also needed to switch to require('react-native-flipper-relay-devtools').addPlugin(); so I updated the documentation. Maybe relay now requires the devtools to be initialized before the environment is created.

janicduplessis avatar Oct 15 '21 17:10 janicduplessis

I have a same issue. 😢

On the flipper console, [Relay DevTools] Connected But still same empty one. image

yomybaby avatar May 23 '22 06:05 yomybaby

I found a solution.

Do not put this code in index.js. The best location might be before create Relay environment. new Enviroment ...

if (__DEV__) {
  require('react-native-flipper-relay-devtools').addPlugin();
}

export default new Environment({
  network: Network.create(fetchRelay),
  store: new Store(new RecordSource()),
  // handlerProvider: null
});

yomybaby avatar May 24 '22 05:05 yomybaby