-1
我已經用最新的v0.11.3取代了卓別林v0.7.0。做完,我現在在Chrome中得到一個JavaScript錯誤:卓別林不能指定只讀屬性'調度員'的[對象對象]
cannot assign to read only property 'dispatcher' of [object Object]
Firefox的報道類似的東西:
[08:46:39.783] TypeError: "dispatcher" is read-only @ http://cdnjs.cloudflare.com/ajax/libs/chaplin/0.11.3/chaplin.min.js?bust=1386629198362:1
發生了什麼變化很可能造成這個問題?在我的Grails應用
啓動代碼:
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.9/require.min.js"></script>
<script>
requirejs.config({
baseUrl: './js/',
paths: {
jquery: '//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min',
'jquery.ui': '//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min',
underscore: '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min',
backbone: '//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min',
handlebars: '//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.1.2/handlebars.min',
text: '//cdnjs.cloudflare.com/ajax/libs/require-text/2.0.10/text',
// chaplin: 'vendor/chaplin-0.7.0',
chaplin: '//cdnjs.cloudflare.com/ajax/libs/chaplin/0.11.3/chaplin.min',
'jquery.bootstrap': '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/js/bootstrap.min',
'highcharts': '//cdnjs.cloudflare.com/ajax/libs/highcharts/3.0.2/highcharts',
'moment': '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.4.0/moment.min'
},
// Underscore and Backbone are not AMD-capable per default,
// so we need to use the AMD wrapping of RequireJS
shim: {
jquery: {
exports: '$'
},
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
handlebars: {
exports: 'Handlebars'
},
'jquery.bootstrap': {
deps: ['jquery']
},
'highcharts': {
deps: ['jquery']
}
}
<g:if env="development">
// For easier development, disable browser caching
// Of course, this should be removed in a production environment
, urlArgs: 'bust=' + (new Date()).getTime()
</g:if>
});
// Bootstrap the application
require(['application'], function(Application) {
var app = new Application();
app.initialize();
});
</script>
除了火狐似乎報告:
[08:46:38.395] Error: Mismatched anonymous define() module: function (Chaplin, routes) {