question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build: Add Safari 10.1 nomodule fix

See original GitHub issue

Safari 10.1 supports modules, but does not support the nomodule attribute - it will load <script nomodule> anyway.

Reference: Modern Script Loading

First, there’s the Safari Fix. Safari 10.1 supports JS Modules not the nomodule attribute on scripts, which causes it to execute both the modern and legacy code (yikes!).

Thankfully, Sam found a way to use a non-standard beforeload event supported in Safari 10 & 11 to polyfill nomodule.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
LarsDenBakkercommented, Jul 23, 2019

We don’t use <script nomodule> for loading the application though, only for a few polyfills. We use a check in javascript so it won’t load both versions of the application if I understand it correctly.

I will do some tests to see how it’s working out right now on 10.1

0reactions
stale[bot]commented, Sep 17, 2019

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Open Web Components!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safari 10.1 `nomodule` support - Discover gists · GitHub
The best solution is to use a script tag and then simply check for module support if module support exists add the module...
Read more >
Safari 10 supports module, but not nomodule - Remy Sharp
Except, of course, Safari 10 doesn't support nomodule . News to me, TIL. So in this case the whole codebase gets run twice....
Read more >
Native ECMAScript modules: nomodule attribute for the ...
To execute a script as a module when in the browser, we need to add the type="module" attribute to it. Browsers without ESM...
Read more >
Modern Script Loading - JASON Format
First, there's the Safari Fix. Safari 10.1 supports JS Modules not the nomodule attribute on scripts, which causes it to execute both the ......
Read more >
SPM in project pre Xcode 11 - 'No … | Apple Developer Forums
Add a Comment ... This project was fine compiling non-Debug builds in Xcode 10. ... I hope they fix it as this will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found