system.js无法正确显示来自babel的错误消息

时间:2016-03-31 20:07:23

标签: babeljs systemjs jspm

当我使用jspmsystem.js babel设置一个非常简单的项目时,似乎没有正确显示错误消息。

我做了以下事情:

npm init; press enter a bunch of times
jspm init; press enter a bunch of times

并添加了两个文件:

index.html

<!DOCTYPE html>
<html>
<head>
  <title>Test</title>
  <script src="jspm_packages/system.js" type="text/javascript"></script>
  <script src="config.js" type="text/javascript"></script>
  <script type="text/javascript">
    console.log('test 1');
    System.import('main');
  </script>
</head>
<body>
</body>
</html>

main.js

console.log('test2);
//                ^ I voluntarily forgot the ' to show the error;

根据this talk以及之前的babel经验,我应该看到一些非常好的语法错误消息,例如:nice error message

但相反,我得到了这个,这是完全神秘的,并没有帮助我一点: not nice error message

由于错误行说system.js:1:0,我认为错误发生在system.js中,并且在调用babel之前失败了。 此外,我注意到es6-module-loader未加载。我以为它是在system.js中使用的。

我不知道我在这里缺少什么。

0 个答案:

没有答案
相关问题