DEV Community

Shin-Young Jung
Shin-Young Jung

Posted on

[Personal Log] iOS Safari Error: React App

While implementing mobile supported web application, I ran into The object can not be found here. error from iOS Safari during testing.

In Desktop web browsers and other browsers in the mobile works fine.

My code looked like followings.


return <div>
    {state === 'LOADING' && <div>Loading</div>}
    {
      type === 'youtube' ? <iframe ... /> : <video ... />
    }
  </div>
Enter fullscreen mode Exit fullscreen mode

This code is pretty simple. It just display the loading during the loading state, and disappears when the data is loaded. However, somehow iOS Safari doesn't like it.

I kept getting the same errors over and over, and eventually I fixed this issue by adding another div wrapper.

return <div>
        {state === 'LOADING' && <div>Loading</div>}
         <div>
           { type === 'youtube' ? 
              <iframe ... /> : <video ... />
           }
         </div>
       </div>
Enter fullscreen mode Exit fullscreen mode

I don't exactly understand what's going on, but I'll find out soon..

Top comments (1)

Collapse
 
o-lie profile image
o-lie

Did you found what was going on exactly?