I am getting this error in vector source when features are specified. The features are getting successfully and the array contains the features
var features = [];
$.ajax({
url: 'geoJSON-url',
dataType: 'json',
async: false,
success: function(json1) {
$.each(json1, function (key, data) {
if (key == 'features') {
$.each(data, function (k, v) {
if (v.type=='Feature') {
features[k] = v;
}
});
}
});
}
});
var source = new VectorSource({
format: new GeoJSON(),
features: features
});