The following line of code produces the title error:
var tweets = <%= tweets %>;
In the chrome console it is displayed as the following:
var tweets = [object Object];
Why is this error being thrown? From similar questions it seems to be an issue of syntax but I am unsure how the above syntax can be changed?
I was initally stringifying the object before sending but this presented errors with unexpected characters being found.