-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polyfill does not run as expected #430
Comments
Import maps are supported natively in modern Chrome - so the polyfill will not apply if you are only relying on a feature like import maps that is already supported. Instead, this is a bug with the code against the native implementation of import maps - that import maps must be loaded before any modules execute on the page and cannot be loaded after a single module has been loaded. Try carefully inspecting your HTML to ensure all module loads come after the import map. |
Thanks for the prompt answer @guybedford. The page has no error and works as expected when browsed without the Random User-Agent (Switcher) Chrome extension. When the extension in enabled though, I get those error messages. I have inspected my HTML however and in both cases, whether the extension is enabled or disabled, I can confirm that there are no module loads before the import map - which is odd given the error message I'm seeing. But what I understand from your reply is that the polyfill will not apply in Chrome, so I guess this issue is not related to es-module-shims. If that's correct I will close this issue and create one issue with importmap-rails instead. |
@benj-p you may find that the root cause here is WICG/import-maps#248. Unfortunately it's a bit of a gotcha, and is best treated as an "extension issue" actually currently. |
Thanks, I had indeed found this issue and I came here to post an issue following your comment ;) |
I have a Rails (7.1.3) app with importmap-rails (2.0.1). We noticed that when visiting the website with the Random User-Agent (Switcher) Chrome extension we get these error messages in the console and importmap does not work.
I would have expected the polyfill to run but it doesn't seem to be the case here. This is what I have in the
head
of my pageAny guidance would be greatly appreciated 🙏
The text was updated successfully, but these errors were encountered: