What can cause 'TypeError: undefined is not an object...`

时间:2016-07-11 19:04:10

标签: javascript backbone.js undefined marionette

From my bugtracker I am seeing this error when deployed:

TypeError: undefined is not an object (evaluating 'e.getRegion("similarRegion").show')

I am trying to reproduce and resolve this but having some trouble diagnosing it. Here is the code where the error is caused:

similarProductView() {
    var view = new SimilarProductView({ 
        collection: this.model.get('relatedProducts'),
        initialLoading: true
    });

    this.model.getRelatedProducts().always(() => {
        this.getRegion('similarRegion').show(view);
    });
},

My main question is what can raise this error? What I have tried, that results in different errors, are making the region a different name (causing the region to not exist), and trying to show a variable that doesn't exist.

Any ideas on what situation would raise this error? Or any suggestions on things to try to reproduce it?

0 个答案:

没有答案