Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aurelia Typescript project only working on Chrome

Does anyone know why Aurelia-Typescript projects listed in this git repository only functions on Chrome browser?

Are there ES6 features that are only currently supported on Chrome and not on IE or FireFox?

EDIT - below are the error messages from Firefox 34.0.5

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create core.js:130

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. index.html

"DEBUG [bootstrapper] loading the HTMLImports polyfill" core.js:2518

The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page.

Error: Script error for: webcomponentsjs/HTMLImports.min http://requirejs.org/docs/errors.html#scripterror require.js:166

like image 642
Chi Row Avatar asked Mar 17 '23 21:03

Chi Row


1 Answers

In aurelia-bundle.js at line 15346 (bootstrapper part) it checks whether HTML import is supported:

      if (!("import" in document.createElement("link"))) {
        logger.debug("loading the HTMLImports polyfill");
        toLoad.push(System.normalize("webcomponentsjs/HTMLImports.min", loaderName).then(function (name) {
          return System["import"](name);
        }));
      }

The only browser that supports it out-of-the-box is still Chrome. For the other browsers HTMLImports polyfill loading fails because:

  1. HTMLImports.min.js is missing from webcomponentsjs directory
  2. The path should be "aurelia/webcomponentsjs/HTMLImports.min". It might be better to move webcomponentsjs to the root path (I don't know how this can be handled through bundling)
  3. Follow @Chi Row's answer below for HTML Template Element polyfill (IE 11 seems supporting them, so it worked without).
like image 168
T.Sol Avatar answered Mar 19 '23 12:03

T.Sol