Closed chabou-san closed 5 years ago
Yeah I think I see what happened here. Essentially the trouble was that the implementation of defaults
was only updating if previously the property was undefined
, thats why the order didn't really matter. So in this line merely switching the second with the third argument should get you rollin.
Can you try out the following please:
node_modules/aurelia-i18n/dist/native-modules/aurelia-i18n-loader.js
Backend.prototype.init = function (services, options) {
if (options === void 0) { options = {}; }
this.services = services;
this.options = Object.assign({}, {
loadPath: "/locales/{{lng}}/{{ns}}.json",
addPath: "locales/add/{{lng}}/{{ns}}",
allowMultiLoading: false,
parse: JSON.parse
}, options);
};
note that options parameter is now at third position
After that try starting your app again and see whether this fixes your issue.
This is exactly what I did to fix the issue on my side and get going. I just didn't take the time to PR that change. So I can confirm it fixes it. 👍
Closing this as the fix was released in beta-2
I'm submitting a bug report
Please tell us about your environment:
Operating System: OSX 10.x
Node Version: 8.11.4
NPM Version: 5.6.0
JSPM OR Webpack AND Version webpack 4.17.2
Browser: all
Language: all
Current behavior: When specifying
options
for the backend at boot of the app using the following piece of code,options
are not taken into account :Actually I found that during conversion to Typescript, this line, using the
defaults
function defined lines later in the same file, has been converted to Object.assign(). But arguments are not taken into account in the same order. As a result of this current use ofObject.assign()
, options are overloaded with the default values.