node-mac-notifier icon indicating copy to clipboard operation
node-mac-notifier copied to clipboard

NSInternalInconsistencyException: Built-in appearance SystemAppearance not found

Open ghost opened this issue 6 years ago • 4 comments

When using node-mac-notifier, getting the following exception which crashes the renderer. Facing this in macOS Catalina. Works fine in macOS Mojave. node-mac-notifier version : 1.2.0

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Critical error: required built-in appearance SystemAppearance not found'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff2d731f53 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6365e835 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2d731da9 +[NSException raise:format:] + 189
	3   libdispatch.dylib                   0x00007fff6497150e _dispatch_client_callout + 8
	4   libdispatch.dylib                   0x00007fff64972686 _dispatch_once_callout + 20
	5   AppKit                              0x00007fff2a87a6f9 +[NSAppearance _initializeCoreUI] + 34
	6   AppKit                              0x00007fff2a87a344 +[NSAppearance _aquaAppearance] + 51
	7   AppKit                              0x00007fff2a93170f -[NSSnapshotContextSignature initWithDrawingRect:applicableForRect:context:hints:] + 461
	8   AppKit                              0x00007fff2a995957 +[NSCGImageSnapshotRep _lockFocusForCreatingSnapshot:withRect:context:hints:flipped:] + 1362
	9   AppKit                              0x00007fff2a9cd9c5 -[NSImageRep CGImageForProposedRect:context:hints:] + 670
	10  Foundation                          0x00007fff30001219 _imageDataForImage + 599
	11  Foundation                          0x00007fff300017ee -[_NSConcreteUserNotification setContentImage:] + 99
	12  Notification.node                   0x00000001129affe1 _ZN15MacNotificationC2EPN3Nan10Utf8StringES2_S2_S2_S2_S2_bS2_ + 515
	13  Notification.node                   0x00000001129af33a _ZN15MacNotification3NewERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE + 588
	14  Notification.node                   0x00000001129b0d48 _ZN3Nan3impL23FunctionCallbackWrapperERKN2v820FunctionCallbackInfoINS1_5ValueEEE + 186
	15  Electron Framework                  0x0000000108b34a3f _ZN2v88internallsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_18BasicBlockProfilerE + 394447
	16  Electron Framework                  0x0000000108af2b18 _ZN2v88internallsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_18BasicBlockProfilerE + 124328
	17  Electron Framework                  0x0000000108af22f7 _ZN2v88internallsERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERKNS0_18BasicBlockProfilerE + 122247
	18  Electron Framework                  0x00000001093b702b _ZN2v88internal12trap_handler17RemoveTrapHandlerEv + 2154779
)
libc++abi.dylib: terminating with uncaught exception of type NSException

ghost avatar Nov 12 '19 13:11 ghost

This issue looks similar, but the trace looks different.

ghost avatar Nov 12 '19 13:11 ghost

Sending notification without an icon seems to work, fails with the above exception when providing data url or image url

ghost avatar Nov 13 '19 12:11 ghost

remote.require('node-mac-notifier') fixed this issue for me

Syed-Umair avatar Oct 28 '20 18:10 Syed-Umair

Based on a report by a zulip-desktop user, this crash seems to follow the warning in #31. I wonder if that’s the root cause?

objc[87760]: Class NotificationCenterDelegate is implemented in both […]/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework (0x10974d0c0) and […]/node_modules/node-mac-notifier/build/Release/Notification.node (0x10a806a20). One of the two will be used. Which one is undefined.

Chromium and node-mac-notifier both define an @interface NotificationCenterDelegate. Can we rename the one in node-mac-notifier?

andersk avatar Nov 20 '20 19:11 andersk