New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working in Electron #23
Comments
Ok, so I did some digging and based on the Electron docs here (https://github.com/electron/electron/blob/master/docs/tutorial/devtools-extension.md) I was able to get Apollo Dev Tools working by adding the following:
The other dev-tools work without having to specify this in my code, but adding this for Apollo Dev Tools got it working. I'm not super familiar with the Dev Tools API's, but I'm curious if there's something that could be changed so that the Dev tools are instantiated, like the other dev tools, without the explicit call being added. I have a feeling it might be related to how the panel is instantiated here: https://github.com/apollographql/apollo-client-devtools/blob/master/extension/devtools.js It seems like the other dev tools create the panel without any conditions being checked, and check conditions inside the panel itself, such as Redux Dev Tools: |
Ah. . . Digging some more, I'm seeing the React Dev Tools doing conditional creation of the panel based on similar criteria to what the Apollo Dev Tools check, however, they've added a listener to check if React is added after page load. My guess is that by time the Apollo Dev Tools are instantiated in Electron it's too early for I'll submit a PR for this. |
We should be polling constantly for that value to show up, so it would be surprising if that were the issue. |
I submitted a PR #24 Not 100% sure yet that solves the issue. I'll play with it a bit more to confirm tomorrow. |
@jasonbahl Were you able to confirm if #24 fixes this issue? If so, I can merge it and release a new version of the devtools :) |
Sorry. Haven't followed up. Will check today and let you know for sure |
So, I'm not exactly sure how to test this locally. From what I can tell, Electron is downloading straight from the Chrome store when compiling, so I'm not quite sure how to override and have it use my local copy of Apollo Devtools instead. . .I'll dig and see if I can figure that out so I can test properly locally. For now, my only solution has been to manually add:
For the moment, that also means I have to manually keep the version number updated, which is obviously not ideal. . . If I can get Electron to use my local copy of DevTools so I can fully test this, I'll let you know. Thanks, Jason |
for now I've settled on just adding this to my app for now:
Since that seems to be working, I'll probably just keep using that. |
did not word for me |
Unfortunately this did not work for me either. It seems to only work for me if I delete everything in the extensions folder of electron and then add the path to the downloaded apollo-client-dev-tools chrome extension. It will work the first time it's loaded, but after quitting and reopening the application, it doesn't load anymore. |
I've got React, Redux and Devtron devtools working in Electron, but can't get apollo-client-devtools working.
I'm using
electron-devtools-installer
and the following:Outputs:
I'm using the same tool to download the other devtools as well.
However, when I open Electron devtools, I only see React, Redux and Devtron devtools, no sign of Apollo devtools.
I followed the logic and it looks like it's supposed to only instantiate if
window.__APOLLO_CLIENT__
is set, andprocess.env.NODE_ENV
is not production, and both are the case for me. . .but I still get no Apollo dev tools.I have a pretty similar setup (same React/Apollo setup) in just a simple JS web app, and Apollo Dev Tools are present in Chrome, but just not in Electron.
I'll try and dig and see if I can find anything.
The text was updated successfully, but these errors were encountered: