-
Notifications
You must be signed in to change notification settings - Fork 16.9k
fix: runtime JS error that crashes GetPackageJSON
#48293
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
fix: runtime JS error that crashes GetPackageJSON
#48293
Conversation
|
FWIW, the type definition for electron/typings/internal-ambient.d.ts Lines 91 to 97 in f702327
|
deepak1556
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
@indutny-signal can you rebase your PR to pick up a fix for the compilation errors? |
a6c6624 to
c789b0b
Compare
|
Force pushed! Signed the commit while I was there. Thank you! |
|
@indutny-signal sorry to ask - can you rebase again to pull in #48345? I tested this fix with your branch and it fixes the build issue seen here. |
c789b0b to
14983a1
Compare
We overriden the `GetPackageJSON` in Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated by `asar.splitPath` that sometimes contrary to its' TypeScript definition returned `false`.
14983a1 to
77bb87b
Compare
|
@jkleinsc force pushed! np! |
|
@jkleinsc no rush with reviewing it, but let me know if you want me to rebase again! |
|
@indutny-signal reran ci and will merge when green! |
|
Looks like it is still not green, but I think the test is flaky? |
|
Should we try once more? 😅 |
|
Release Notes Persisted
|
|
I have automatically backported this PR to "37-x-y", please check out #48423 |
|
I have automatically backported this PR to "38-x-y", please check out #48424 |
|
I have automatically backported this PR to "39-x-y", please check out #48425 |
|
Aww, thank you! |
We overriden the `GetPackageJSON` in Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated by `asar.splitPath` that sometimes contrary to its' TypeScript definition returned `false`.
We overriden the `GetPackageJSON` in Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated by `asar.splitPath` that sometimes contrary to its' TypeScript definition returned `false`.
We overriden the `GetPackageJSON` in Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated by `asar.splitPath` that sometimes contrary to its' TypeScript definition returned `false`.
We overriden the `GetPackageJSON` in Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated by `asar.splitPath` that sometimes contrary to its' TypeScript definition returned `false`.
Description of Change
We overriden the
GetPackageJSONin Node.js to let us read files straight from the ASAR file instead of disk. The override works by providing a JS method with the limitation that it should not throw a runtime error. However, this invariant was accidentally violated byasar.splitPaththat sometimes contrary to its' TypeScript definition returnedfalse.Checklist
npm testpassescc @zcbenz @nikwen
Example of crash stack
Release Notes
Notes: fix: runtime JS error that crashes
GetPackageJSON