I have an app running on Backbone in front-end and when a browser loads a page it returns an error in the console:
Uncaught ReferenceError: app is not defined
at index.js:6
at index.js:51
(anonymous) @ index.js:6
(anonymous) @ index.js:51
index.js
/* global app:true */
(function() {
'use strict';
app = app || {}; // error here although it must prevent of undefined
// variables stay undefined
//.......
//backbone code here
//.......
$(document).ready(function() {
app.contactView = new app.ContactView(); //error here
});
}());
Switching from build to CDN or enter into a Backbone.Model properties returns the same error.