profile
viewpoint

Ask questionsSvelte applications fail to load in IE 11. Similar loading issue with the main site svelte.dev

image

Digging closer the error is on this line:

const identity = x => x;

I suspect I need a polyfill but there doesn't seem to be an appropriate one. Svelte version: 3.0.0

The home page: https://svelte.dev/ gives this error: (as of 30/04/2019)

image

IE version:

image

sveltejs/svelte

Answer questions assmith

Sorry for appending to a closed thread, but since this is the first hit that comes up when looking for IE11 and Sapper issues I thought I should post here. Sapper uses document.baseURI in goto and prefetch which isn't supported in IE11 and doesn't appear to be polyfilled by Babel or polyfill.io.

TypeError: Invalid scheme

is a hint that this might be biting you.

I found this patch which works for me when added to template.html along with the polyfill.io polyfills mentioned in Usage of shimport makes legacy support prohibitively challenging

source: https://github.com/webcomponents/webcomponents-platform/issues/2

if ('baseURI' in Node.prototype === false) {
  Object.defineProperty(Node.prototype, 'baseURI', {
    get: function() {
      var base = (this.ownerDocument || this).querySelector('base');
      return (base || window.location).href;
    },
    configurable: true,
    enumerable: true
  });
}

Maybe a polyfill for this could be added to --legacy builds automatically in a future release?

useful!
source:https://uonfu.com/
Github User Rank List