caperaven
caperaven

Reputation: 37

aurelia 1.0.1 / systemjs / and safari not working

trying run an aurelia v1.0.1 app in safari gives me a very strange error.

Error: eval@[native code]
    promiseReactionJob@[native code]
    Evaluating http://localhost:8080/app/src/main.js
    Error loading http://localhost:8080/app/src/main.js — system.src.js:5031

I tried adding the aurelia-polyfills but that id not do the trick. main.js looks like

import "aurelia-polyfills";

export function configure(aurelia) {
    return new Promise((resolve) => {
        aurelia.use
            .standardConfiguration()
            .developmentLogging();

        aurelia.start().then(() => {
            aurelia.setRoot();
            resolve();
        });
    });
}

In chrome and firefox everything is fine. Any ideas?

ps, the systemjs code that the error refers to is

else if (typeof importScripts !== 'undefined') {
  var basePath = '';
  try {
    throw new Error('_');
  } catch (e) {
    e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
      $__curScript = { src: url };
      basePath = url.replace(/\/[^\/]*$/, '/');
    });
  }
  if (doPolyfill)
    importScripts(basePath + 'system-polyfills.js');
  bootstrap();
}
else {
  $__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
  bootstrap();
}

The second last line "bootstrap()" being the line refered to by the error.enter code here

Upvotes: 2

Views: 211

Answers (1)

caperaven
caperaven

Reputation: 37

I installed chrome os and got a better error. It turns out that the code typescript is generating is es2015 so it was the arrow functions causing the issue.

Transpiling it to es5 solved the problem.

Upvotes: 1

Related Questions