nw.js: Crash on First Launch

The most recent build of my application (Shaxpir) has been crashing on first launch, on Mac OS Sierra, and I’m not sure why… I’m using NWJS 0.21.4, but I’m using my own build scripts to do code-signing and building the PKG installer. When I start the application, the icon appears in the dock for about one second, and then disappears. The main application window never appears.

If I open the Console application, I can see the following error message in system.log:

Apr  2 13:50:37 Benjis-MBP Shaxpir[51902]: [0402/135037.372796:FATAL:chrome_main_delegate.cc(792)] Check failed: !command_line.HasSwitch(switches::kProcessType) && process_type.empty(). Main application forbids --type, saw renderer
	0   nwjs Framework                      0x000000010a11aa73 _ZN2v88UnlockerD1Ev + 15204243
	1   nwjs Framework                      0x000000010a133bf7 _ZN2v88UnlockerD1Ev + 15307031
	2   nwjs Framework                      0x000000010883ebc3 ChromeMain + 3539
	3   nwjs Framework                      0x000000010883ecd4 ChromeMain + 3812
	4   nwjs Framework                      0x0000000109d4fd42 _ZN2v88UnlockerD1Ev + 11227746
	5   nwjs Framework                      0x0000000109d4f39e _ZN2v88UnlockerD1Ev + 11225278
	6   nwjs Framework                      0x000000010883de3b ChromeMain + 75
	7   Shaxpir                             0x0000000105a60daa main + 522
	8   libdyld.dylib                       0x00007fff988ac255 start + 1
	9   ???                                 0x0000000000000017 0x0 + 23
Apr  2 13:50:37 Benjis-MBP com.apple.xpc.launchd[1] (com.shaxpir.desktop.230176[51898]): Service exited with abnormal code: 5

I’ve attached two crash-dump files generated during this crash:

crash-dumps.zip

If anyone can help me understand why this crash is occurring, and what I might need to do to fix it, I’d be very grateful!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30 (15 by maintainers)

Most upvoted comments

Actually, @rogerwang, I think you did reproduce the bug… For some reason, the PKG installer isn’t being built correctly (no helper app!) and therefore it crashes on first launch.

The reason I filed this bug is because there’s no reliable tooling for building and signing a PKG installer of a NWJS app for Macintosh, so I cobbled together a build script the best I could… And it seemed to work pretty well for a year, only to stop working recently (with 0.21.4). But I don’t know why it stopped working… Has something changed recently in the internal NWJS directory structure on Mac?

I tried referring to the Support for Mac App Store instructions, but they seem to be out of date.

Incidentally, it would be nice to have future build scripts written in Javascript (rather than python) since JS is a more natural fit for the skillsets of people using NWJS in the first place…

YOU have merged (and closed) my issue with this one, six hours ago!!!