-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[DevTools Bug]: Electron support broken in 4.27 #25843
Comments
@Kilian: We're sorry you've seen this error. ❤️ It looks like you forgot to specify a valid URL. (This means that we will not be able to reproduce the problem you're reporting.) Please help us by providing a link to a CodeSandbox (https://codesandbox.io/s/new), a repository on GitHub, or a minimal code example that reproduces the problem. (Screenshots or videos can also be helpful if they help provide context on how to repro the bug.) Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve Issues without repros are automatically closed but we will re-open if you update with repro info. |
Thank you for providing repro steps! Re-opening issue now for triage. |
Ah I see. I'll try implement a fallback logic and release a fix. |
I wrote up some quick downgrade instructions for Electron apps (replace "Polypane" with your app name): https://polypane.app/docs/downgrading-react-devtools/ |
Thanks @Kilian ; I turned your fix into a script, tested on Windows in Git Bash extension="/path/to/your/data/extensions/fmkadmapgofadopljbjfkapdkoienihi"
manifest="$extension/manifest.json"
if ! [ -f $manifest ]; then
echo manifest doesn\'t exist, cannot patch
exit 0
fi
md5=`md5sum $manifest | awk '{split($0,a," "); print a[1]}'`
if [ "$md5" = "e821851e1ba9ff96244025afa8178b06" ]; then
echo manifest is already correct
exit 0
fi
echo fixing extension
curl https://polypane.app/fmkadmapgofadopljbjfkapdkoienihi.zip --output extensions-fix.zip
rm -r $extension
mkdir $extension
unzip extensions-fix.zip -d $extension
rm extensions-fix.zip |
@mondaychen Hey, can I work on this issue? Any tips on how to start? Would be glad to help! |
@filipefborba sorry, I think I put the "good first issue" label there by mistake. It's a bit to complex to set things up if you are new to this project. |
Also my apologies to people who are impacted by this: I wanted to work on this earlier, but we are extremely understaffed at this moment, and I got pretty swamped in the past a few weeks. I should be able to work on this no later than next week. |
@mondaychen no worries! If you find anything other "good first issue" or want/need some help, let me know. Also, I'm sorry that you've been swamped, that's never cool. Hope everything gets better! =) |
tldr; This should be considered an Electron issue. For now, please follow the instructions at the end of this comment. Hi everyone, After some digging into the issue, I realized that it's not possible to create a version that works on both the latest Chrome & Electron, because:
The only possible solution here is to revert the Manifest V3 upgrade. IMO that would be the wrong move. Chrome has announced that it will drop support for Manifest V2 by Jan 2023 (see https://developer.chrome.com/blog/mv2-transition/). Although they have decided to push back the hard deadline, it's unlikely that it will be pushed back forever. It's especially ironic that Electron also warns you "Manifest version 2 is deprecated and support will be removed in 2023" when you load an extension, while they don't have the API of Manifest V3. So, in my opinion, Electron should add support for Workaround
|
Hi guys! Is this problem still there? I tried to get the latest version of Electron React Boilerplate, and i still have problems with the DevTools extension. Do we have any news? Thanks! Davide |
@eltaurito I just ran into the same problem with ERB as well |
@Kilian @eltaurito @madenney try this repo: https://github.com/xupea/electron-devtools-installer, which may ease your pain |
Thank you @xupea ! I've installed the package:
But this is what i get on the console:
And if I try to run my project and open the Components extension i get this: |
@eltaurito seems it's still using v3 of react devtool, and |
I deleted the extension folder, now it works perfectly 👍👍 👍 Thank you a lot @xupea ! |
@xupea That worked for me as well, thanks so much. On a Mac you can find Electron extensions here: |
That version seems to be having issues with electron 24.
I published https://www.npmjs.com/package/electron-extension-installer to fix that (source code here) import { installExtension, REACT_DEVELOPER_TOOLS } from "electron-extension-installer";
app.on("ready", async () => {
await installExtension(REACT_DEVELOPER_TOOLS, {
loadExtensionOptions: {
allowFileAccess: true,
},
});
}); |
@jonluca what issues did you get? |
Install React Devtools extension when running in dev mode. If the path to extension (unpackaged extension) is not provided via env variable, the extension will try downloading & installing the extension automatically. Note: The extension might not work with newer manifest version as electron has some missing APIs used by React Devtools. In such case, consider downloading an older version of React Devtools or use a modified version of the same supporting an older manifest version for the time being and set the environment variable `REACT_DEVTOOLS_EXT_PATH` accordingly pointing to the unpackaged extension Ref: facebook/react#25843 (comment)
electron version is 22,node version is 16.14.0 |
Kilian, the script link does not exist anymore: "Page not found" |
Any news regarding this matter yet? |
Using Wayback Machine, edited with the original instructions from author: 1. Download React-devtools 4.25[Polypane] have prepared a zip file with react-devtools 4.25 here: 2. Open [your app] extensions folderOpen the following folder in your explorer/finder:
3. Add or replace the current version with the version downloaded in step 1If you have installed react-devtools:
If you do not have react-devtools installed:
4. Restart [your app]After restarting [your app], react-devtools should work again. [Your app] will not automatically download new versions so unless you manually refresh, they should continue to work. |
…wnloaded from this issue: facebook/react#25843 (comment)
Should be fixed with Electron v27.0.0+ (and also v25.9.0 and v26.3.0) with this pull request. |
But DevTools 4.27.5+ has a bug with loading local file URLs in Electron: |
6127570289
…On Mon, Feb 19, 2024, 1:57 AM Bartel Eerdekens ***@***.***> wrote:
But DevTools 4.27.5+ has a bug with loading local file URLs in Electron:
#27749 <#27749>
—
Reply to this email directly, view it on GitHub
<#25843 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK54M6KYNVVOYLUT3RMB4DTYUMAXVAVCNFSM6AAAAAASWZU6DKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRHA3TONZUGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
It appears |
@JordanDC2 I think it's already using manifest v3... there are other issues getting React Devtools working in Electron though: |
Website or app
Electron.js
Repro steps
React devtools 4.27 no longer works in Electron[1] because
chrome.scripting
isn't implemented, which it started using due to the manifest v3 upgrade: #25145When opening React devtools 4.27 in any Electron project (installed with `electron-devtools-installer for example) you'll see that the devtools panel is shown but no React components are ever found. Earlier versions worked well with Electron
[1] electron/electron#36545 and MarshallOfSound/electron-devtools-installer#232
How often does this bug happen?
Every time
DevTools package (automated)
No response
DevTools version (automated)
No response
Error message (automated)
No response
Error call stack (automated)
No response
Error component stack (automated)
No response
GitHub query string (automated)
No response
The text was updated successfully, but these errors were encountered: