aurelia 1.0.1 / systemjs /和safari无法正常工作

时间:2016-09-10 09:02:11

标签: safari aurelia

在safari中尝试运行aurelia v1.0.1应用程序给了我一个非常奇怪的错误。

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

我尝试添加aurelia-polyfills,但是id不能解决问题。 main.js看起来像

import "aurelia-polyfills";

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

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

在chrome和firefox中一切都很好。 有什么想法吗?

ps,错误引用的systemjs代码是

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();
}

第二行“bootstrap()”是错误引用的行。enter code here

1 个答案:

答案 0 :(得分:1)

我安装了chrome操作系统并得到了更好的错误。 事实证明,代码打字稿生成的是es2015,因此导致问题的是箭头函数。

将其映射到es5解决了这个问题。