lukeed/dimport

IOS Safari 10: TypeError: Module name constructs an invalid URL

srobertson421 opened this issue · 1 comments

Getting this error when using dimport via script tags in Safari 10 on ipad:

TypeError: Module name constructs an invalid URL.

HTML script tags:

<script type="module" src="https://unpkg.com/dimport?module" data-main="/main.js"></script>
  <script nomodule src="https://unpkg.com/dimport/nomodule" data-main="/main.js"></script>

Debugger is hitting at this line in the transpiled code:

return new Function("return import('" + o + "')").call();

I've included the dimport scripts as part of my Svelte build and they bootstrap the app itself. Any help would be appreciated!

Make window.import = dimport.

That way the function just matches a window global. Basically make your own polyfill