electron-vite / electron-vite-react

:electron: Electron + Vite + React + Sass boilerplate.
https://electron-vite.github.io
MIT License
1.93k stars 240 forks source link

React Developer Tools add failed #207

Open tonyada opened 8 months ago

tonyada commented 8 months ago

Describe the problem you confuse

any help?

RSS1102 commented 8 months ago

Are you using the React Google Chrome plugin within Electron?

Stanzilla commented 5 months ago

Are you using the React Google Chrome plugin within Electron?

Yeah that's the only way atm. I have the same issue, trying to install react and redux devtools. It works in production/packaged app but not in dev mode. Using https://github.com/MarshallOfSound/electron-devtools-installer

@caoxiemeihao any ideas?

Stanzilla commented 5 months ago

@caoxiemeihao any chance you could take a look at this?

Imaginativeone commented 4 months ago

Is there a way to offer a bounty for resolving this issue? I'll start the bidding with $100.

caoxiemeihao commented 4 months ago

@caoxiemeihao any chance you could take a look at this?

@Stanzilla Sorry, I just saw this message. I've been very busy at work recently. I'll take some time to look at this issue.

Stanzilla commented 4 months ago

@caoxiemeihao any chance you could take a look at this?

@Stanzilla Sorry, I just saw this message. I've been very busy at work recently. I'll take some time to look at this issue.

Awesome, thank you! Glad that you found a new job as well, I remember you were looking!

caoxiemeihao commented 4 months ago

@Stanzilla I noticed your comments about this issue elsewhere. Maybe we need to wait for an official response from Electron.

Stanzilla commented 4 months ago

@Stanzilla I noticed your comments about this issue elsewhere. Maybe we need to wait for an official response from Electron.

I'm not sure since it does work in build mode my guess is that vite just does not know where to look for the files in dev mode.

Imaginativeone commented 4 months ago

@Stanzilla I noticed your comments about this issue elsewhere. Maybe we need to wait for an official response from Electron.

Is there a way to expedite an official response from Electron?

silyont commented 3 months ago

To everyone got struggled:

I found a workaround to add back react devtools to electron. The root cause is the default startup argument --no-sandbox in electron-vite-plugin. Therefore I tried to modify vite.config.mts like this:

electron([
  {
    entry: 'electron/main.ts',
    onstart: (option) => option.startup(['.']),
    // ... other configs
  },
  // ... other configs
])
Stanzilla commented 3 months ago

To everyone got struggled:

I found a workaround to add back react devtools to electron. The root cause is the default startup argument --no-sandbox in electron-vite-plugin. Therefore I tried to modify vite.config.mts like this:

electron([
  {
    entry: 'electron/main.ts',
    onstart: (option) => option.startup(['.']),
    // ... other configs
  },
  // ... other configs
])

Oh my god, it works, thank you!