Skip to content
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

Menu.Item type="Quit" throwing error #18

Closed
kaseyhinton opened this issue Feb 18, 2018 · 12 comments
Closed

Menu.Item type="Quit" throwing error #18

kaseyhinton opened this issue Feb 18, 2018 · 12 comments

Comments

@kaseyhinton
Copy link
Contributor

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
@kusti8
Copy link
Owner

kusti8 commented Feb 19, 2018

What's the full output ?

@kusti8
Copy link
Owner

kusti8 commented Mar 8, 2018

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

@kusti8 kusti8 closed this as completed Mar 8, 2018
@mischnic
Copy link
Contributor

mischnic commented 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>

@kusti8 kusti8 reopened this Mar 8, 2018
@mischnic
Copy link
Contributor

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

@parro-it
Copy link
Contributor

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

@mischnic
Copy link
Contributor

Yes, exact same error.

@mischnic
Copy link
Contributor

mischnic commented Mar 17, 2018

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

@parro-it
Copy link
Contributor

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

@mischnic
Copy link
Contributor

mischnic commented Mar 17, 2018

Proposed fix: Removing line

onClick: () => {},

Would this have other side effects?

@kusti8
Copy link
Owner

kusti8 commented Mar 17, 2018 via email

@mischnic
Copy link
Contributor

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: andlabs/libui#301.


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

@andlabs
Copy link

andlabs commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants