Importmap Not Working on iOS

yegorckv

Yegor Chsherbakov

Posted on October 22, 2024

Importmap Not Working on iOS

I recently encountered an issue where my JavaScript scripts stopped working on iPhones and iPads (tested on Safari, Chrome, and Firefox). The root cause turned out to be the removal of the es-module-shim module in importmaps-rails 2.0, which was responsible for ES module support in older browsers.

Removing this module breaks the scripts on iOS devices.

Simple solution: To restore JavaScript functionality, add the following script to your application file:

<script async src="https://unpkg.com/es-module-shims"></script>
Enter fullscreen mode Exit fullscreen mode

You can read more about the removal of the module in the article: world.hey.com/importmaps-rails 2.0 dropped es-module-shim.

💖 💪 🙅 🚩
yegorckv
Yegor Chsherbakov

Posted on October 22, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related