stencil-app-starter icon indicating copy to clipboard operation
stencil-app-starter copied to clipboard

Stencil build web component not loading on iOS WKWebView

Open devendrashewale3 opened this issue 1 year ago • 2 comments

I am traying to create Web component using stencil JS . Stencil build folder which has index.html actually loads the my stencil component. This Web components works fine on Mac os Safari browser and Android WebView however same build folder does not load on iOS WKWebView so I would like to ask the question to the stencil community does stencil web components are compatible with iOS WKWebView browser if yes then what would be probable root cause for not loading web component on iOS WKWebView. I have implemented WKNavigationDelegate, WKUIDelegate callbacks on the Swift ViewController which includes WKWebView instance. Normal HTML works fine however not showing content which embedded on the Stencil component. I have also checked all the required build files are available on the resource path. Below is the index.html code

<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <script type="module" src="/build/demo.esm.js" data-stencil></script> <script nomodule="" src="/build/demo.js" data-stencil></script> </head> <body> <my-component first="param1" middle="param2" last="param3"></body></html>

devendrashewale3 avatar Sep 10 '24 07:09 devendrashewale3

I don't have an iOS device here but many updates were done in #95 Can you give it a fresh test and let us know if this is potentially now resolved ?

valadas avatar Nov 09 '24 05:11 valadas

Seeing as all Ionic components are built using Stencil, yes, they are supported on iOS. That said, I am not sure what the specific issue is here, but you may find some inspiration by looking into the Ionic Framework components to see if there are any differences in the way you are implementing versus the way they do things in Ionic Framework.

david-poindexter avatar Nov 09 '24 16:11 david-poindexter