#Blank Page in Dev mode, on Electron 22.0.0, but works fine in Electron 21.3.3

1 messages · Page 1 of 1 (latest)

astral pumice
#

Hi!

I use a library called "Nextron" which is basically NextJS and Electron in one.
There were few vulnerabilities with the included dependencies. (namely got and minimatch)

So I ended up updating electron-builder, @electron-universal and electron to get them all to disappear.

Now to the problem..
For some reason, on Electron 22.0.0, the app is completely blank in dev mode, but works fine in a production build.
On Electron 21.3.3 (Electron 20.x too) it works fine in both dev and prod build.
I do not get any useful errors at all. This is all I see, and it appears in the nodejs console window:

[4212:1201/104023.250:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
url loaded
devtools opened
[10688:1201/104223.060:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is

I've tried different command line flags to disable gpu and hardware acceleration (by using app.commandLine.appendSwitch), and still no difference. So I think that error is unrelated.

This is what my BrowserWindow options are set to:
Would appreciate any replies. ✌️

robust bear
#

any errors in console with 232?

astral pumice
#

23 as in Electron 23?

#

In that case, I haven't tried it, give me a moment.

robust bear
#

whoops sorry

#

i meant 22

#

i don't think 23 is out yet

astral pumice
#

yeah, it isn't. Just checked

#

and no, no errors on 22 besides from what I posted above

#

the "Failed to send GpuControl.CreateCommandBuffer."

robust bear
#

no. in electron browser console

astral pumice
#

oh, no

#

Just a warning about CSP

robust bear
#

interesting

#

Are your elements present in that window?

astral pumice
#

It seems to find everything too, just doesn't render it

robust bear
#

Looks like the content is there

#

Do you have some kind of css checks for dev/production mode ?

#

Usually when you hover over a tag in that panel it should highlight if it exists

astral pumice
astral pumice
robust bear
#

so strange

#

is this on a public repo?

astral pumice
robust bear
#

lemme try

astral pumice
#
  "devDependencies": {
    "@types/node": "^16.11.7",
    "@types/react": "^18.0.8",
    "autoprefixer": "^10.4.7",
    "electron": "^22.0.0",
    "electron-builder": "^23.3.3",
    "next": "^12.2.5",
    "nextron": "^8.2.0",
    "postcss": "^8.4.13",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "tailwindcss": "^3.1.8",
    "typescript": "^4.8.2"
  }

These are the package.json, that's about the only changes I've made

#

Changing the electron one to 21.3.3 doesn't cause this behavior

robust bear
#

I see the same thing

#

Time to file an issue with the author for you

astral pumice
#

Thank you, I appreciate it, this is my first time using Electron and I was honestly unsure where to report this behavior

#

Didn't know whether this was a Nextron, Electron or electorn-builder issue

robust bear
#

I think its a nextron issue

#

but it is strange that it works with 21

#

Maybe you should stick to 21 for now

astral pumice
#

I guess, should I be worried about the got vuln? It doesn't really specify how it can be exploited, other than that the fix disables redirects to UNIX sockets now.

robust bear
#

what is that?

#

first time i'm hearing of i t

astral pumice
#

npm audit report

got <11.8.5
Severity: moderate
Got allows a redirect to a UNIX socket - https://github.com/advisories/GHSA-pfrx-2q88-qq97
fix available via npm audit fix --force
Will install [email protected], which is a breaking change
node_modules/got
@electron/get <=1.14.1
Depends on vulnerable versions of got
node_modules/@electron/get
electron 7.0.0-beta.1 - 21.3.3
Depends on vulnerable versions of @electron/get
node_modules/electron

3 moderate severity vulnerabilities

#

it's the only reason why I was trying 22.0.0

robust bear
#

ah. I think you could use yarn workspaces to force the subpackage to update?

#

if not bring this issue up in the nextron repo

astral pumice
#

Sure. Thank you, appreciate the help.
I'll file a report with Nextron & give yarn workspaces a try.

robust bear
#

Just double check those too

astral pumice
#

yeah I've checked both nextron and electron-builder, none of them uses those things

#

Unless this is another way of using the "new-window" event

#

Heading to lunch now, if there is anything you'd like me to try or w.e, ping me.

robust bear
#

i'm going to sleep lol

#

its 3am

#

but if i think of anything will let you know

astral pumice
#

Oh I see, sleep well!

astral pumice
#

I think I found the cause, for whatever reason, on Electron 22.0 NextJS inserts <style data-next-hide-fouc="true">body{display:none}</style> into the head.
When I delete it under the elements tab, things starts appearing on the screen

robust bear
#

Ah. You could probably wait for your app to load and then remove that style in next

astral pumice
astral pumice
#

I found the cause, it's something in NextJS or nextron that doesn't like something new happening in Electron

#

It's as if Electron is starting in a different order in 22, compared to 21.3.3

astral pumice
#

@robust bear Sorry if this is not appropriate by the rules, but figuring it's better than pinging you in a public channel or starting new forum post over a quick question.

After reading a bit on the docs, I realized I could just do win.loadUrl (win being an instance of BrowserWindow).
I've been trying to find anything on the docs about it, but haven't so far, but is there something I should keep in mind by using this?

For context, this is for a website that's already built in NextJS, it's not meant to be a replacement, or anything, just an another way of accessing it instead of a browser.
Hopefully it all makes sense. 😅

robust bear
#

nop

#

works just like you think it does

astral pumice
#

Amazing! Thank you for all the help by the way. Can't say I've had the same experience in the NextJS Discord server and the Nextron GitHub repo, but I suppose everyone have their moments of being busy.

robust bear
#

next has a discord?

#

i didn't even know

astral pumice
#

I found it few months ago on their GitHub's readme I think, or maybe their docs... I do not have the best memory.

robust bear
#

Ah good to know

#

Thanks for the info. This will be useful in the future