I am trying to setup aurelia-validation plugin in my project. I am using VS2015. I have installed aurelia-validation plugin using jspm install aurelia-validation mand.
Config.js file has been updated "aurelia-validation": "github:aurelia/[email protected]" and in jspm_packages/github I see [email protected] folder.
I have added a plugin in my main.js file.
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-validation');
aurelia.start().then(a => a.setRoot());
}
and have changed my aurelia-app to aurelia-app="main"
When I start the app I get the following error in Firefox console:
Unhandled promise rejection TypeError: aurelia.globalizeResources is not a function
Stack trace:
configure@http://localhost:15724/jspm_packages/github/aurelia/[email protected]/index.js:28:5
loadPlugin/<@http://localhost:15724/jspm_packages/github/aurelia/[email protected]/aurelia-framework.js:34:32
run@http://localhost:15724/jspm_packages/npm/[email protected]/modules/es6.promise.js:91:43
notify/<@http://localhost:15724/jspm_packages/npm/[email protected]/modules/es6.promise.js:105:11
module.exports@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.invoke.js:6:25
@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:40:9
run@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:27:7
listner@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:31:5
I have tried clearing jspm cache with jspm cc mand but that didn't help. All my packages are up to date.
What am I missing?
Thank you.
I am trying to setup aurelia-validation plugin in my project. I am using VS2015. I have installed aurelia-validation plugin using jspm install aurelia-validation mand.
Config.js file has been updated "aurelia-validation": "github:aurelia/[email protected]" and in jspm_packages/github I see [email protected] folder.
I have added a plugin in my main.js file.
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-validation');
aurelia.start().then(a => a.setRoot());
}
and have changed my aurelia-app to aurelia-app="main"
When I start the app I get the following error in Firefox console:
Unhandled promise rejection TypeError: aurelia.globalizeResources is not a function
Stack trace:
configure@http://localhost:15724/jspm_packages/github/aurelia/[email protected]/index.js:28:5
loadPlugin/<@http://localhost:15724/jspm_packages/github/aurelia/[email protected]/aurelia-framework.js:34:32
run@http://localhost:15724/jspm_packages/npm/[email protected]/modules/es6.promise.js:91:43
notify/<@http://localhost:15724/jspm_packages/npm/[email protected]/modules/es6.promise.js:105:11
module.exports@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.invoke.js:6:25
@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:40:9
run@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:27:7
listner@http://localhost:15724/jspm_packages/npm/[email protected]/modules/$.task.js:31:5
I have tried clearing jspm cache with jspm cc mand but that didn't help. All my packages are up to date.
What am I missing?
Thank you.
Share Improve this question edited Oct 12, 2016 at 22:59 Jeremy Danyow 26.4k12 gold badges90 silver badges135 bronze badges asked Aug 19, 2015 at 18:59 partyelitepartyelite 8922 gold badges15 silver badges27 bronze badges2 Answers
Reset to default 6There was a breaking change in Aurelia 0.15.0:
In the mit fix(all): create a property framework configuration object
the globalizeResources
method was renamed to globalResources
Since then (2015.08.13) the aurelia-validation plugin hasn't been updated.
You get the error because the aurelia-validation only supports aurelia 0.14.1 or older. So you have to downgrade your aurelia version to work with the validation plugin until it is not updated.
The accepted answer is correct. A quick fix (to avoid downgrading aurelia) would be to manually edit this line: https://github./aurelia/validation/blob/master/dist/system/index.js#L10
in your jspm_packages\github\aurelia\validation...
folder
Also change any aurelia.withSingleton
calls to aurelia.container.registerSingleton
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744228723a4564137.html
评论列表(0条)