[GH-ISSUE #18] Menu.Item type="Quit" throwing error #10

Closed
opened 2026-05-05 11:23:15 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @kaseyhinton on GitHub (Feb 18, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/18

The quit menu item is throwing an error. Using windows 10.

<Menu.Item type="Quit"></Menu.Item>

Here is the error

npm ERR! code ELIFECYCLE
npm ERR! errno 2147483651
npm ERR! notepad@1.0.0 start: `babel-node index.js`
npm ERR! Exit status 2147483651
Originally created by @kaseyhinton on GitHub (Feb 18, 2018). Original GitHub issue: https://github.com/kusti8/proton-native/issues/18 The quit menu item is throwing an error. Using windows 10. ```javascript <Menu.Item type="Quit"></Menu.Item> ``` Here is the error ```bash npm ERR! code ELIFECYCLE npm ERR! errno 2147483651 npm ERR! notepad@1.0.0 start: `babel-node index.js` npm ERR! Exit status 2147483651 ```
Author
Owner

@kusti8 commented on GitHub (Feb 19, 2018):

What's the full output ?

<!-- gh-comment-id:366689384 --> @kusti8 commented on GitHub (Feb 19, 2018): What's the full output ?
Author
Owner

@kusti8 commented on GitHub (Mar 8, 2018):

Closing due to inactivity. Feel free to open it if the issue persists.

<!-- gh-comment-id:371360357 --> @kusti8 commented on GitHub (Mar 8, 2018): Closing due to inactivity. Feel free to open it if the issue persists.
Author
Owner

@mischnic commented on GitHub (Mar 8, 2018):

@kusti8
That really is the full output:

I'm guessing there is some error in native code (hence no error details).

$ npm run notes

> proton-native@1.0.14 notes C:\Users\nikla\Desktop\DEV\proton-native
> babel-node examples/Notepad/index.js

npm ERR! code ELIFECYCLE
npm ERR! errno 2147483651
npm ERR! proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js`
npm ERR! Exit status 2147483651
npm ERR!
npm ERR! Failed at the proton-native@1.0.14 notes script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\nikla\AppData\Roaming\npm-cache\_logs\2018-03-08T11_32_57_429Z-debug.log

log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'notes' ]
2 info using npm@5.6.0
3 info using node@v9.7.1
4 verbose run-script [ 'prenotes', 'notes', 'postnotes' ]
5 info lifecycle proton-native@1.0.14~prenotes: proton-native@1.0.14
6 info lifecycle proton-native@1.0.14~notes: proton-native@1.0.14
7 verbose lifecycle proton-native@1.0.14~notes: unsafe-perm in lifecycle true
8 verbose lifecycle proton-native@1.0.14~notes: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\nikla\Desktop\DEV\proton-native\node_modules\.bin;C:\Users\nikla\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\nikla\bin;C:\Users\nikla\.windows-build-tools\python27;C:\Users\nikla\.windows-build-tools\python27\Scripts;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Users\nikla\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\nikla\AppData\Local\Programs\Python\Python36;C:\Users\nikla\AppData\Local\Microsoft\WindowsApps;C:\Users\nikla\AppData\Local\GitHubDesktop\bin;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Users\nikla\AppData\Roaming\npm;C:\Users\nikla\AppData\Local\Yarn\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle proton-native@1.0.14~notes: CWD: C:\Users\nikla\Desktop\DEV\proton-native
10 silly lifecycle proton-native@1.0.14~notes: Args: [ '/d /s /c', 'babel-node examples/Notepad/index.js' ]
11 silly lifecycle proton-native@1.0.14~notes: Returned: code: 2147483651  signal: null
12 info lifecycle proton-native@1.0.14~notes: Failed to exec notes script
13 verbose stack Error: proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js`
13 verbose stack Exit status 2147483651
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:127:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:127:13)
13 verbose stack     at maybeClose (internal/child_process.js:936:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid proton-native@1.0.14
15 verbose cwd C:\Users\nikla\Desktop\DEV\proton-native
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "notes"
18 verbose node v9.7.1
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 2147483651
22 error proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js`
22 error Exit status 2147483651
23 error Failed at the proton-native@1.0.14 notes script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2147483651, true ]

code:

<App>
    <Menu label="File">
        <Menu.Item type="Item" onClick={() => this.open()}>Open</Menu.Item>
        <Menu.Item type="Item" onClick={() => this.save()}>Save</Menu.Item>
        <Menu.Item type="Quit"></Menu.Item>
    </Menu>
    <Window title="Notes" size={{w: 500, h: 500}}>
        <Box>
            <TextInput onChange={text => this.setState({text})} multiline={true}>{this.state.text}</TextInput>
        </Box>
    </Window>
</App>
<!-- gh-comment-id:371462213 --> @mischnic commented on GitHub (Mar 8, 2018): @kusti8 That really is the full output: I'm guessing there is some error in native code (hence no error details). ``` $ npm run notes > proton-native@1.0.14 notes C:\Users\nikla\Desktop\DEV\proton-native > babel-node examples/Notepad/index.js npm ERR! code ELIFECYCLE npm ERR! errno 2147483651 npm ERR! proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js` npm ERR! Exit status 2147483651 npm ERR! npm ERR! Failed at the proton-native@1.0.14 notes script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\nikla\AppData\Roaming\npm-cache\_logs\2018-03-08T11_32_57_429Z-debug.log ``` log: ``` 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'notes' ] 2 info using npm@5.6.0 3 info using node@v9.7.1 4 verbose run-script [ 'prenotes', 'notes', 'postnotes' ] 5 info lifecycle proton-native@1.0.14~prenotes: proton-native@1.0.14 6 info lifecycle proton-native@1.0.14~notes: proton-native@1.0.14 7 verbose lifecycle proton-native@1.0.14~notes: unsafe-perm in lifecycle true 8 verbose lifecycle proton-native@1.0.14~notes: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\nikla\Desktop\DEV\proton-native\node_modules\.bin;C:\Users\nikla\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\nikla\bin;C:\Users\nikla\.windows-build-tools\python27;C:\Users\nikla\.windows-build-tools\python27\Scripts;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Users\nikla\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\nikla\AppData\Local\Programs\Python\Python36;C:\Users\nikla\AppData\Local\Microsoft\WindowsApps;C:\Users\nikla\AppData\Local\GitHubDesktop\bin;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Users\nikla\AppData\Roaming\npm;C:\Users\nikla\AppData\Local\Yarn\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl 9 verbose lifecycle proton-native@1.0.14~notes: CWD: C:\Users\nikla\Desktop\DEV\proton-native 10 silly lifecycle proton-native@1.0.14~notes: Args: [ '/d /s /c', 'babel-node examples/Notepad/index.js' ] 11 silly lifecycle proton-native@1.0.14~notes: Returned: code: 2147483651 signal: null 12 info lifecycle proton-native@1.0.14~notes: Failed to exec notes script 13 verbose stack Error: proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js` 13 verbose stack Exit status 2147483651 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16) 13 verbose stack at EventEmitter.emit (events.js:127:13) 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:127:13) 13 verbose stack at maybeClose (internal/child_process.js:936:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid proton-native@1.0.14 15 verbose cwd C:\Users\nikla\Desktop\DEV\proton-native 16 verbose Windows_NT 10.0.16299 17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "notes" 18 verbose node v9.7.1 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 2147483651 22 error proton-native@1.0.14 notes: `babel-node examples/Notepad/index.js` 22 error Exit status 2147483651 23 error Failed at the proton-native@1.0.14 notes script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 2147483651, true ] ``` code: ```jsx <App> <Menu label="File"> <Menu.Item type="Item" onClick={() => this.open()}>Open</Menu.Item> <Menu.Item type="Item" onClick={() => this.save()}>Save</Menu.Item> <Menu.Item type="Quit"></Menu.Item> </Menu> <Window title="Notes" size={{w: 500, h: 500}}> <Box> <TextInput onChange={text => this.setState({text})} multiline={true}>{this.state.text}</TextInput> </Box> </Window> </App> ```
Author
Owner

@mischnic commented on GitHub (Mar 17, 2018):

@parro-it This looks like some crash in native code (libui-node) ? My attempts at using a debugger on Windows weren't successful.

<!-- gh-comment-id:373914029 --> @mischnic commented on GitHub (Mar 17, 2018): @parro-it This looks like some crash in native code (libui-node) ? My attempts at using a debugger on Windows weren't successful.
Author
Owner

@parro-it commented on GitHub (Mar 17, 2018):

It seems. Did you already try it with the 0_1_0 branch? I will otherwise...

<!-- gh-comment-id:373925859 --> @parro-it commented on GitHub (Mar 17, 2018): It seems. Did you already try it with the 0_1_0 branch? I will otherwise...
Author
Owner

@mischnic commented on GitHub (Mar 17, 2018):

Yes, exact same error.

<!-- gh-comment-id:373927702 --> @mischnic commented on GitHub (Mar 17, 2018): Yes, exact same error.
Author
Owner

@mischnic commented on GitHub (Mar 17, 2018):

proton-native calls UiMenuItem.onClicked also on type="Quit" items. This causes the crash.

<!-- gh-comment-id:373929491 --> @mischnic commented on GitHub (Mar 17, 2018): proton-native calls `UiMenuItem.onClicked` also on `type="Quit"` items. This causes the crash.
Author
Owner

@parro-it commented on GitHub (Mar 17, 2018):

I will try it tonight... I developed the new version on seven, I didn't yet tested it on 10.

<!-- gh-comment-id:373931238 --> @parro-it commented on GitHub (Mar 17, 2018): I will try it tonight... I developed the new version on seven, I didn't yet tested it on 10.
Author
Owner

@mischnic commented on GitHub (Mar 17, 2018):

Proposed fix: Removing line

7741dd2fcc/src/components/MenuBar.js (L83)

Would this have other side effects?

<!-- gh-comment-id:373933028 --> @mischnic commented on GitHub (Mar 17, 2018): Proposed fix: Removing line https://github.com/kusti8/proton-native/blob/7741dd2fccbce773ce4bea709fef30b2773e82d5/src/components/MenuBar.js#L83 Would this have other side effects?
Author
Owner

@kusti8 commented on GitHub (Mar 17, 2018):

It shouldn't. Cause then when it's iterating through the props, it just
won't set that.

On Sat, Mar 17, 2018, 12:25 PM Niklas Mischkulnig notifications@github.com
wrote:

Proposed fix: Removing line

7741dd2fcc/src/components/MenuBar.js (L83)

Would this have other consequences?


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/kusti8/proton-native/issues/18#issuecomment-373933028,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJW73GyYQZQQtARo_tuycU2Wqy4gYjT8ks5tfTkFgaJpZM4SJnBo
.

<!-- gh-comment-id:373933470 --> @kusti8 commented on GitHub (Mar 17, 2018): It shouldn't. Cause then when it's iterating through the props, it just won't set that. On Sat, Mar 17, 2018, 12:25 PM Niklas Mischkulnig <notifications@github.com> wrote: > Proposed fix: Removing line > > > https://github.com/kusti8/proton-native/blob/7741dd2fccbce773ce4bea709fef30b2773e82d5/src/components/MenuBar.js#L83 > > Would this have other consequences? > > — > You are receiving this because you modified the open/close state. > > > Reply to this email directly, view it on GitHub > <https://github.com/kusti8/proton-native/issues/18#issuecomment-373933028>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AJW73GyYQZQQtARo_tuycU2Wqy4gYjT8ks5tfTkFgaJpZM4SJnBo> > . >
Author
Owner

@mischnic commented on GitHub (Mar 18, 2018):

On macOS, libui prints an error before it quits:

You can't call uiMenuItemOnClicked() on a Quit item; use uiOnShouldQuit() instead.

Not on Windows, I created an issue: https://github.com/andlabs/libui/issues/301.


(Any idea why proton-native works fine on macOS?)

<!-- gh-comment-id:374000260 --> @mischnic commented on GitHub (Mar 18, 2018): On macOS, libui prints an error before it quits: ``` You can't call uiMenuItemOnClicked() on a Quit item; use uiOnShouldQuit() instead. ``` Not on Windows, I created an issue: https://github.com/andlabs/libui/issues/301. --- (Any idea why proton-native works fine on macOS?)
Author
Owner

@andlabs commented on GitHub (Mar 18, 2018):

As I said in that other issue, on Windows libui prints things to the debug log, which is your only real course of action on a /subsystem:windows program; you can use SysInternals DebugView if you aren't running in an actual debugger. I could make it print to stderr in addition to that, maybe... or provide a custom reporting option, maybe...

<!-- gh-comment-id:374002938 --> @andlabs commented on GitHub (Mar 18, 2018): As I said in that other issue, on Windows libui prints things to the debug log, which is your only real course of action on a `/subsystem:windows` program; you can use SysInternals DebugView if you aren't running in an actual debugger. I could make it print to stderr in addition to that, maybe... or provide a custom reporting option, maybe...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#10
No description provided.