Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

standard-things/electron-quick-start silently crashes - global reference issue #507

Closed
JosephClay opened this issue Jul 16, 2018 · 5 comments

Comments

@JosephClay
Copy link

JosephClay commented Jul 16, 2018

Including lodash into standard-things/electron-quick-start causes it to hang and crash silently.

I tracked it down to _freeGlobal.js. Changing the global reference to this fixes the issue, however, I think this reveals a larger interop problem with esm & electron

requireing lodash works normally

@jdalton
Copy link
Member

jdalton commented Jul 16, 2018

Hi @JosephClay!

Which version of lodash are you using?

@JosephClay
Copy link
Author

4.17.10

@jdalton
Copy link
Member

jdalton commented Jul 16, 2018

I can't repo this locally. Can you provide a snippet for your usage?

Update:

Is it in the main thread or renderer thread? Basically please give me details so I can better repro the issue. If I have to guess chances are I'll guess wrong.

@JosephClay
Copy link
Author

JosephClay commented Jul 16, 2018

fork reproducing the issue

Issue is in the renderer thread. Expecting to see a log of [1] before the Hello from the renderer process! log, but get the following (without any log in the terminal):
screen shot 2018-07-16 at 5 19 53 pm

on Mac 10.13.5, node 10.5.0, npm 6.1.0

@jdalton
Copy link
Member

jdalton commented Jul 17, 2018

Hi!

I narrowed it down to simple operation. It looks like electron (v3 beta2 at least) doesn't like

"a" in global

check from with a vm instance. You can replace the script tag in the index.html with:

<script>
const vm = require('vm')
  vm.runInNewContext("'a' in global", { 
    global: Function("return this")()
  })
</script>

and it will crash out too.

I can and will work around this, but this feels like an electron bug.

Update:

I filed Electron issue electron/electron#13690.

Update:

v3.0.72 is released 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants