Select to view content in your preferred language

Vite build with 4.28 has issues with webkit (iOS safari/chrome)

898
2
Jump to solution
12-04-2023 01:14 PM
BryanMc
Occasional Contributor

I'm describing an issue beyond my abilities at this point. I'm upgrading my app: ArcGIS Maps SDK 4.27 (4.27.6) application to 4.28 (4.28.10) and hit a very odd issue. The app is built with Vite.js 4.5 (Node 18) using the ArcGIS SDK's ES Modules. Just a basic html/javascript app being built there and copied to the webserver.

When I use Vite build with 4.27 everything works fine on all browser environments. When building with 4.28, I noticed a graphics layer would not add (to draw some graphics) on iOS Safari and iOS Google Chrome (WebKit) using iOS 17.1.2. Well, all graphics layers wouldn't add. The error  for each states "Esri.view.LayerViewManager failed to create layerview for layer....". The details of the error are all blank (layerview-create-error wasn't much help).

I was digging into possible issues with the layer not being ready, etc - however the layer is being added after map is loaded (and verified), with everything fine when using 4.27.

My thought is that there is a dependency leveraged in 4.27 that isn't referenced with 4.28 (or missing for graphics layers, or layers in general), that only iOS Webkit was relying on. However, this is where I'm now out of my depths (no pun intended). Doesn't happen when just in dev mode (vite dev), but happens with Vite Build. But rebuilding on 4.27 again works, deleting and installing all modules 4.27 works too. But same steps continue to not work with 4.28. Only for adding of layers - main map works.

0 Kudos
1 Solution

Accepted Solutions
AndyGup
Esri Regular Contributor

Hi@BryanMc  can you reproduce this outside of Vite in a vanilla JS app using the ArcGIS ESM CDN? Also, we'll need a github repo or stackblitz so we can try to reproduce the issue. Reference: https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md

View solution in original post

0 Kudos
2 Replies
AndyGup
Esri Regular Contributor

Hi@BryanMc  can you reproduce this outside of Vite in a vanilla JS app using the ArcGIS ESM CDN? Also, we'll need a github repo or stackblitz so we can try to reproduce the issue. Reference: https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md

0 Kudos
BryanMc
Occasional Contributor

Thank you @AndyGup. I tried a quick app using the ArcGIS ESM CDN and everything works. I did a simple app test with Vite and it works too. My larger app is fine until I change the ArcGIS SDK version, but could be due to many other factors outside of this I guess. Appreciate your time and helpful reference docs as well. If I ever isolate the issue I'll post in here if relevant.

0 Kudos