skpm / sketch-module-web-view

A sketch module for creating an complex UI with a webview
MIT License
289 stars 62 forks source link

Sketch crashes while loading images #79

Closed bjudson closed 5 years ago

bjudson commented 5 years ago

I'm working on a plugin using the webview, and when I load images from our API, Sketch crashes fairly consistently (though not 100% of the time). The images are loaded by putting an API endpoint into the image src, and the API redirects to an S3 URL. Loading the built webview contents into Safari, I have no problems. Any help would be appreciated.

Here's a stacktrace:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff772d001e __abort_with_payload + 10
1   libsystem_kernel.dylib          0x00007fff772cb541 abort_with_payload_wrapper_internal + 82
2   libsystem_kernel.dylib          0x00007fff772cb4ef abort_with_reason + 22
3   libobjc.A.dylib                 0x00007fff760ac674 _objc_fatalv(unsigned long long, unsigned long long, char const*, __va_list_tag*) + 108
4   libobjc.A.dylib                 0x00007fff760ac526 _objc_fatal(char const*, ...) + 135
5   libobjc.A.dylib                 0x00007fff7609cc30 lookUpImpOrForward + 773
6   libobjc.A.dylib                 0x00007fff7609c494 _objc_msgSend_uncached + 68
7   com.apple.CFNetwork             0x00007fff48e21937 -[NSURLAuthenticationChallengeInternal initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:] + 195
8   com.apple.CFNetwork             0x00007fff48f0ee1c -[NSURLAuthenticationChallenge initWithAuthenticationChallenge:sender:] + 211
9   com.apple.WebKit                0x00007fff58e6de27 -[WKObject isKindOfClass:] + 55
10  com.cocoascript.CocoaScript     0x000000010ac2635b -[Mocha JSValueForObject:] + 75
11  com.cocoascript.CocoaScript     0x000000010ac4d708 __MOGetBlockForJavaScriptFunction_block_invoke + 536
12  com.apple.WebKit                0x00007fff58b681f7 WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebKit::WebPageProxy&, WebKit::AuthenticationChallengeProxy&) + 309
13  com.apple.WebKit                0x00007fff58d70fc9 WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy(unsigned long long, WTF::Ref<WebKit::AuthenticationChallengeProxy, WTF::DumbPtrTraits<WebKit::AuthenticationChallengeProxy> >&&) + 161
14  com.apple.WebKit                0x00007fff58bcbd24 WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge(unsigned long long, unsigned long long, WebCore::AuthenticationChallenge&&, unsigned long long) + 202
15  com.apple.WebKit                0x00007fff58bd1686 void IPC::handleMessage<Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge, WebKit::NetworkProcessProxy, void (WebKit::NetworkProcessProxy::*)(unsigned long long, unsigned long long, WebCore::AuthenticationChallenge&&, unsigned long long)>(IPC::Decoder&, WebKit::NetworkProcessProxy*, void (WebKit::NetworkProcessProxy::*)(unsigned long long, unsigned long long, WebCore::AuthenticationChallenge&&, unsigned long long)) + 174
16  com.apple.WebKit                0x00007fff58b30204 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 130
17  com.apple.WebKit                0x00007fff58b33411 IPC::Connection::dispatchOneIncomingMessage() + 177
18  com.apple.JavaScriptCore        0x00007fff4d55c4e7 WTF::RunLoop::performWork() + 231
19  com.apple.JavaScriptCore        0x00007fff4d55c772 WTF::RunLoop::performWork(void*) + 34
20  com.apple.CoreFoundation        0x00007fff49f58475 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21  com.apple.CoreFoundation        0x00007fff49f5841b __CFRunLoopDoSource0 + 108
22  com.apple.CoreFoundation        0x00007fff49f3beb5 __CFRunLoopDoSources0 + 195
23  com.apple.CoreFoundation        0x00007fff49f3b45e __CFRunLoopRun + 1219
24  com.apple.CoreFoundation        0x00007fff49f3ad48 CFRunLoopRunSpecific + 463
25  com.apple.HIToolbox             0x00007fff491d1ab5 RunCurrentEventLoopInMode + 293
26  com.apple.HIToolbox             0x00007fff491d17eb ReceiveNextEventCommon + 618
27  com.apple.HIToolbox             0x00007fff491d1568 _BlockUntilNextEventMatchingListInModeWithFilter + 64
28  com.apple.AppKit                0x00007fff4748c363 _DPSNextEvent + 997
29  com.apple.AppKit                0x00007fff4748b102 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
30  com.apple.AppKit                0x00007fff47485165 -[NSApplication run] + 699
31  com.apple.AppKit                0x00007fff474748a3 NSApplicationMain + 780
32  libdyld.dylib                   0x00007fff77178ed9 start + 1
mathieudutour commented 5 years ago

what version are you using? I believe I fixed it in 2.1.2

bjudson commented 5 years ago

2.1.1 🤦‍♂️

Upgraded & that fixed it.