【发布时间】:2016-12-15 15:59:44
【问题描述】:
更新:
我的困惑是我将客户端库误认为插件一词
这里记录了安装和使用库:
http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/6
原帖:
我正在尝试将 firebase 与新的 aurelia 应用一起使用。
我找到了这个文档:
http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/app-configuration-and-startup/7
npm install -g aurelia-cli
au new APPNAME
cd APPNAME
jspm install firebase
// main.js
//... included default code omitted
var firebaseConfig = {
apiKey: "...",
authDomain: "...",
//... etc
};
// SECURITY CREDENTIALS IN YOUR SOURCE CODE??????????
// Yes, I KNOW not to put secure credentials in my source code.
// This is just a silly learning app on my own development machine
// trying to learn how to use both Aurelia and Firebase.
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.feature('resources')
.plugin('firebase', firebaseConfig);
//... included default code omitted
}
au run --watch 加载正常
在我的浏览器和控制台中加载 http://localhost:9000 会发生这种情况:
DEBUG [aurelia] Loading plugin aurelia-templating-binding.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin aurelia-templating-binding.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin aurelia-templating-resources.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin aurelia-templating-resources.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin aurelia-event-aggregator.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin aurelia-event-aggregator.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin aurelia-history-browser.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin aurelia-history-browser.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin aurelia-templating-router.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin aurelia-templating-router.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin resources/index.
vendor-bundle.js:13938 DEBUG [aurelia] Configured plugin resources/index.
vendor-bundle.js:13938 DEBUG [aurelia] Loading plugin firebase.
http://localhost:9000/src/firebase.js Failed to load resource: the server responded with a status of 404 (Not Found)
vendor-bundle.js:1399 Unhandled rejection Error: Script error for "firebase"
http://requirejs.org/docs/errors.html#scripterror
at makeError (http://localhost:9000/scripts/vendor-bundle.js:3924:17)
at HTMLScriptElement.onScriptError (http://localhost:9000/scripts/vendor-bundle.js:5491:36)
From previous event:
at DefaultLoader.loadModule (http://localhost:9000/scripts/vendor-bundle.js:13673:14)
at _loadPlugin (http://localhost:9000/scripts/vendor-bundle.js:12719:21)
at http://localhost:9000/scripts/vendor-bundle.js:12712:16
From previous event:
at loadPlugin (http://localhost:9000/scripts/vendor-bundle.js:12711:75)
at next (http://localhost:9000/scripts/vendor-bundle.js:12972:20)
From previous event:
at next (http://localhost:9000/scripts/vendor-bundle.js:12972:56)
at http://localhost:9000/scripts/vendor-bundle.js:12979:16
From previous event:
at FrameworkConfiguration.apply (http://localhost:9000/scripts/vendor-bundle.js:12964:44)
at Aurelia.start (http://localhost:9000/scripts/vendor-bundle.js:12581:23)
at Object.configure (http://localhost:9000/scripts/app-bundle.js:93:13)
at http://localhost:9000/scripts/vendor-bundle.js:11485:22
From previous event:
at config (http://localhost:9000/scripts/vendor-bundle.js:11480:48)
at handleApp (http://localhost:9000/scripts/vendor-bundle.js:11471:12)
at http://localhost:9000/scripts/vendor-bundle.js:11504:13
From previous event:
at http://localhost:9000/scripts/vendor-bundle.js:11502:40
From previous event:
at http://localhost:9000/scripts/vendor-bundle.js:11501:29
From previous event:
at run (http://localhost:9000/scripts/vendor-bundle.js:11497:26)
at Object.<anonymous> (http://localhost:9000/scripts/vendor-bundle.js:11524:3)
at Object.execCb (http://localhost:9000/scripts/vendor-bundle.js:5449:33)
at Module.check (http://localhost:9000/scripts/vendor-bundle.js:4637:51)
at Module.enable (http://localhost:9000/scripts/vendor-bundle.js:4929:22)
at Object.enable (http://localhost:9000/scripts/vendor-bundle.js:5310:39)
at Module.<anonymous> (http://localhost:9000/scripts/vendor-bundle.js:4914:33)
at http://localhost:9000/scripts/vendor-bundle.js:3890:23
at each (http://localhost:9000/scripts/vendor-bundle.js:3815:31)
at Module.enable (http://localhost:9000/scripts/vendor-bundle.js:4866:17)
at Module.init (http://localhost:9000/scripts/vendor-bundle.js:4542:26)
at http://localhost:9000/scripts/vendor-bundle.js:5213:36
【问题讨论】:
标签: javascript firebase jspm aurelia