使用AWS设置覆盖工厂时的OpenEDX RequireJS错误

时间:2018-11-06 15:31:18

标签: requirejs openedx

当部署到服务器而不是devstack时,OpenEDX出现问题。在devstack上,覆盖效果完美,尽管在dev上无法加载。

我要覆盖student_account/account_settings.html以及student_account/views/account_settings_factory.jsstudent_account/views/account_settings_view.js

在加载LMS的帐户部分时,在生产环境中会产生以下错误,但在dev上不会发生:

Mismatched anonymous define() module: function(gettext, $, _, Backbone, Logger, UserAccountModel, UserPreferencesModel,
                 AccountSettingsFieldViews, AccountSettingsView, StringUtils) {
        return function(
            fieldsData,
            ordersHistoryData,
            authData,
            passwordResetSupportUrl,
            userAccountsApiUrl,
            userPreferencesApiUrl,
            accountUserId,
            platformName,
            contactEmail,
            allowEmailChange
        ) {
            var accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData,
                accountsSectionData, ordersSectionData, accountSettingsView, showAccountSettingsPage,
                showLoadingError, orderNumber, getUserField, userFields, countryDropdownField, emailFieldView;

            accountSettingsElement = $('.wrapper-account-settings');

            userAccountModel = new UserAccountModel();
            userAccountModel.…

我工厂中的定义如下:

(function(define, undefined) {
'use strict';
define([
    'gettext', 'jquery', 'underscore', 'backbone', 'logger',
    'js/student_account/models/user_account_model',
    'js/student_account/models/user_preferences_model',
    'js/student_account/views/account_settings_fields',
    'academy/js/student_account/views/account_settings_view',
    'edx-ui-toolkit/js/utils/string-utils'
], function(gettext, $, _, Backbone, Logger, UserAccountModel, UserPreferencesModel,
             AccountSettingsFieldViews, AccountSettingsView, StringUtils) {
如前所述,在开发中可以完美地工作,但是生产会引发错误。希望有人知道该问题的解决方案。

1 个答案:

答案 0 :(得分:0)

问题是因为出于某些原因,在AWS paver设置中,预期定制工厂将得到优化,这可以通过覆盖lms的build.js文件来完成。这个问题在文档中的任何地方都还不清楚,因此很难得出这个结论。