lightbasenl / react-native-panorama-view

A simple component for displaying panoramic images in your React Native app.
MIT License
127 stars 47 forks source link

iOS build fails if request type is optional #60

Closed owinter86 closed 2 years ago

owinter86 commented 3 years ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @lightbase/react-native-panorama-view@1.0.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@lightbase/react-native-panorama-view/ios/PanoramaView.swift b/node_modules/@lightbase/react-native-panorama-view/ios/PanoramaView.swift
index 09309f1..c5d0570 100644
--- a/node_modules/@lightbase/react-native-panorama-view/ios/PanoramaView.swift
+++ b/node_modules/@lightbase/react-native-panorama-view/ios/PanoramaView.swift
@@ -40,7 +40,7 @@ import Foundation
                 self.cancel?()
                 self.cancel = nil

-                self.cancel = loader.loadImage(with: request, callback: { (error, image) in
+                self.cancel = loader.loadImage(with: request!, callback: { (error, image) in

                     DispatchQueue.main.async {

This issue body was partially generated by patch-package.

LuuchoRocha commented 3 years ago

Thanks for the workaround. I'm experiencing the same issue

cristianoccazinsp commented 2 years ago

Why would request be optional? I'm not getting any build errors, is this an issue with RN 0.64 ?

LuuchoRocha commented 2 years ago

@cristianoccazinsp Yes, I'm experiencing this issue with 0.64.2. Using latest Xcode on big sur, targeting iOS >= 13. I don't have the time for debugging and checking the issue right now, but my app won't build without applying the mentioned patch. Eventually, I'll try to make a PR

cristianoccazinsp commented 2 years ago

Strange, when I test the change it builds with and without the extra ! as that call is bridged between objc and swift. I’m using RN 0.62 so perhaps they changed something there.

cristianoccazinsp commented 2 years ago

Fixed in https://github.com/lightbasenl/react-native-panorama-view/pull/67

Looks like this became an issue after RN 0.63 or above.