本文介绍了ReferenceError:找不到变量:在http:// localhost:7357 / assets / test-loader.js,第3行定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Ember CLI插件从0.1.9升级到0.2.0,并且在运行 ember test --server 时遇到此错误:

I'm upgrading my Ember CLI addon from 0.1.9 to 0.2.0, and am hitting this error when running ember test --server:

ember服务可以工作,我可以在浏览器中访问 / tests ,但是似乎有其他东西破坏了testem /幻影设置。

ember serve works, and I can visit /tests in the browser, but something else seems to have broken the testem/phantom setup.

我已经升级了Phantom,并通过 ember init 进行了几次比较,但是我必须仍然缺少某些内容。

I've upgraded Phantom, and went through the ember init diffs several times, but I must still be missing something.

推荐答案

问题是我在中的一个文件中使用了ES6语法/ addon 。那里还不支持ES6,因此引发了此错误。

The problem was I had used ES6 syntax in one of my files in /addon. ES6 isn't supported there (yet), so it was throwing this error.

删除ES6(在本例中为反跳)解决了该问题。

Removing the ES6 (in this case, back ticks) solved the problem.

只需 npm install --save ember-cli-babel 在您的插件中获得Babel支持 / addon 目录中的文件。

Simply npm install --save ember-cli-babel in your addon to get Babel support for the files in your /addon directory.

这篇关于ReferenceError:找不到变量:在http:// localhost:7357 / assets / test-loader.js,第3行定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 03:06