Forum not work well in my custom theme

I am running ironwood release and in default theme, the forum works fine. In development mode, it works fine too. But when in production, my custom theme will cause an frontend error. I don’t know how to solve this problem.
What might causing this? Any suggestion would be appreciated.

Below is the error from my browser console:

JQMIGRATE: Migrate is installed with logging active, version 1.4.1
commons.004f5b2a86f4b4464ea3.e18c22953351.js:114 TypeError: Cannot read property ‘cookieName’ of null
at f (CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1)
at o.value (CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1)
at commitLifeCycles (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at t (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at b (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at y (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at p (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at m (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at Object.updateContainer (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
l @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
t @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
b @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
y @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
p @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
m @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
updateContainer @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
(anonymous) @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
unbatchedUpdates @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
hn @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
render @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:122
value @ ReactRenderer.38f3e5ba7663cd969581.4f3dd33a415e.js:1
e @ ReactRenderer.38f3e5ba7663cd969581.4f3dd33a415e.js:1
(anonymous) @ VM1252:197
commons.004f5b2a86f4b4464ea3.e18c22953351.js:114 Uncaught TypeError: Cannot read property ‘cookieName’ of null
at f (CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1)
at o.value (CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1)
at commitLifeCycles (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at t (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at b (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at y (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at p (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at m (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at Object.updateContainer (commons.004f5b2a86f4b4464ea3.e18c22953351.js:114)
at commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
f @ CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1
value @ CookiePolicyBanner.fe631af4297905cdcfe5.13b564e86f3c.js:1
commitLifeCycles @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
t @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
b @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
y @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
p @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
m @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
updateContainer @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
(anonymous) @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
unbatchedUpdates @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
hn @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:114
render @ commons.004f5b2a86f4b4464ea3.e18c22953351.js:122
value @ ReactRenderer.38f3e5ba7663cd969581.4f3dd33a415e.js:1
e @ ReactRenderer.38f3e5ba7663cd969581.4f3dd33a415e.js:1
(anonymous) @ VM1252:197
DevTools failed to load SourceMap: Could not load content for http://course.ergune.com/static/common/js/vendor/bootstrap.bundle.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
lms-base-vendor.cb449c35a4fc.js:formatted:5688 JQMIGRATE: jQuery.browser is deprecated
migrateWarn @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
get @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
(anonymous) @ noreferrer.aa62a3e70ffa.js:8
(anonymous) @ noreferrer.aa62a3e70ffa.js:10
(anonymous) @ noreferrer.aa62a3e70ffa.js:10
lms-base-vendor.cb449c35a4fc.js:formatted:5690 console.trace
migrateWarn @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
get @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
(anonymous) @ noreferrer.aa62a3e70ffa.js:8
(anonymous) @ noreferrer.aa62a3e70ffa.js:10
(anonymous) @ noreferrer.aa62a3e70ffa.js:10
(index):466 GET http://course.ergune.com/static/css/fonts/mnglwhiteotf.1c0f20345650.ttf 404 (Not Found)
lms-base-vendor.cb449c35a4fc.js:formatted:5688 JQMIGRATE: jQuery.fn.toggle(handler, handler…) is deprecated
migrateWarn @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
jQuery.fn.toggle @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
(anonymous) @ lms-base-application.2062f84b79fa.js:1
fire @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
fireWith @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
ready @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
completed @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
lms-base-vendor.cb449c35a4fc.js:formatted:5690 console.trace
migrateWarn @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
jQuery.fn.toggle @ lms-base-vendor.cb449c35a4fc.js:formatted:5447
(anonymous) @ lms-base-application.2062f84b79fa.js:1
fire @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
fireWith @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
ready @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
completed @ lms-base-vendor.cb449c35a4fc.js:formatted:1267
lms-base-vendor.cb449c35a4fc.js:formatted:10135 Uncaught Error: Mismatched anonymous define() module: function($, Backbone, Content, Discussion, DiscussionUtil, DiscussionCourseSettings, DiscussionUser,
NewPostView, DiscussionRouter, DiscussionBoardView) {
return function(options) {
var userInfo = options.userInfo,
sortPreference = options.sortPreference,
threads = options.threads,
threadPages = options.threadPages,
isCommentableDivided = options.isCommentableDivided,
contentInfo = options.contentInfo,
user = new DiscussionUser(userInfo),
discussion,
courseSettings,
newPostView,
discussionBoardView,
router,
routerEvents;

            // TODO: eliminate usage of global variables when possible
            if (options.roles === undefined) {
                options.roles = {};
            }
            DiscussionUtil.loadRoles(options.roles);
            window.$$course_id = options.courseId;
            window.courseName = options.courseName;
            DiscussionUtil.setUser(user);
            window.user = user;
            Content.loadContentInfos(contentInfo);

            // Create a discussion model
            discussion = new Discussion(threads, {pages: threadPages, sort: sortPreference,
                is_commentable_divided: isCommentableDivided});
            courseSettings = new DiscussionCourseSettings(options.courseSettings);

            // Create the discussion board view
            discussionBoardView = new DiscussionBoardView({
                el: $('.discussion-board'),
                discussion: discussion,
                courseSettings: courseSettings
            });
            discussionBoardView.render();

            // Create the new post view
            newPostView = new NewPostView({
                el: $('.new-post-article'),
                collection: discussion,
                course_settings: courseSettings,
                discussionBoardView: discussionBoardView,
                mode: 'tab',
                startHeader: 2,
                topicId: options.defaultTopicId
            });
            newPostView.render();

            // Set up a router to manage the page's history
            router = new DiscussionRouter({
                rootUrl: options.rootUrl,
                discussion: discussion,
                courseSettings: courseSettings,
                discussionBoardView: discussionBoardView,
                newPostView: newPostView
            });
            router.start();
            routerEvents = {
                // Add new breadcrumbs and clear search box when the user selects topics
                'topic:selected': function(topic) {
                    router.discussionBoardView.breadcrumbs.model.set('contents', topic);
                },
                // Clear search box when a thread is selected
                'thread:selected': function() {
                    router.discussionBoardView.searchView.clearSearch();
                }
            };
            Object.keys(routerEvents).forEach(function(key) {
                router.discussionBoardView.on(key, routerEvents[key]);
            });
        };
    }

http://requirejs.org/docs/errors.html#mismatch
at makeError (lms-base-vendor.cb449c35a4fc.js:formatted:10135)
at intakeDefines (lms-base-vendor.cb449c35a4fc.js:formatted:10784)
at Object.localRequire [as require] (lms-base-vendor.cb449c35a4fc.js:formatted:10912)
at requirejs (lms-base-vendor.cb449c35a4fc.js:formatted:11092)
at HTMLDocument. ((index):1749)
at fire (lms-base-vendor.cb449c35a4fc.js:formatted:1727)
at Object.fireWith [as resolveWith] (lms-base-vendor.cb449c35a4fc.js:formatted:1814)
at Function.ready (lms-base-vendor.cb449c35a4fc.js:formatted:1941)
at HTMLDocument.completed (lms-base-vendor.cb449c35a4fc.js:formatted:1951)