readium/r2-navigator-swift

iOS versions 12 & 13 can't open a book since Readium 2.1.0

openm1nd opened this issue · 1 comments

Bug Report

Try to present the ebook reader

What happened?

Stuck on loading screen (just an activity indicator rotates in the center of the screen)

Expected behavior

An ebook first page should be shown

How to reproduce?

Just try to present the ebook reader

Environment

iOS 13, 12

Readium versions

  • r2-shared-swift: 2.1.0
  • r2-streamer-swift: 2.1.0
  • r2-navigator-swift: 2.1.0
  • r2-opds-swift: 2.1.0
  • r2-lcp-swift: 2.1.0

Development environment

macOS: 11.6
platform: x86_64
carthage: 0.38.0

Testing device

  • iOS version: iOS 12
  • Model (e.g. iPhone 6):
  • Is it an emulator? No
  • iOS version: iOS 13
  • Model (e.g. iPhone 6S):
  • Is it an emulator? Yes

Additional context

I see only this error:

❌ EPUBSpreadView.swift:162: Error Domain=WKErrorDomain Code=5 "JavaScript execution returned a result of an unsupported type" UserInfo={NSLocalizedDescription=JavaScript execution returned a result of an unsupported type}

Please, note that I am using "readium" variable in the JS that throws this error. The problem still persist If I remove all of my custom js

Simulator Screen Shot - iPhone 6s - 2021-10-06 at 14 46 07

I couldn't reproduce the problem from the test app (with the tag 2.2.1, which is using Readium 2.1.0, and using make cocoapods to use CocoaPods integration), using iPad 6th gen with iOS 12.4 (I don't have any real device with iOS 12 or 13).

I'm not sure what would cause this error, but here's a few ideas to help you debug this:

  • Did you try on iOS 14 or 15 as well? Just to rule out the OS version.
  • I would try using a vanilla r2-navigator-swift 2.1.0 in place of your fork, just to make sure it's not something introduced with your customizations.
  • If you enable the Readium logs with R2EnableLog(withMinimumSeverityLevel: .debug), you should see the JavaScript executed before this error, if it is sent from the Swift side.
  • You can try opening the web page with the Safari Web Inspector and then refresh (Cmd-R) to see if you don't get more details about the error.