I was using 4.1 for almost 2 years ago, and my site started to crash last week, debugging my code I realized we stopped getting some of the nested data as we were expecting, I suppose there was a change in the cosmicjs api, I have a structure of nested objects in cosmic, something like this pages -> sections -> videos, the reason why my site started to crash is because of the data of the last object in my nesting chain was different, I was expecting an object with the whole data, instead of that, I was getting a string with just the id.
Before
{
// rest of the page data,
metadata: {
sections: [
{
// rest of the object's metadata,
video: {
// whole video's metadata
}
}
]
}
}
Before
{
// rest of the page data,
metadata: {
sections: [
{
// rest of the object's metadata,
video: '60d10806dd65e129d4f2870b' // just a single string
}
]
}
}
I updated the package to the latest version and I kept having this issue, this article says there are no breaking changes https://www.cosmicjs.com/changelog/npm-module-updates-v4-2, however, I had to change the implementation from bucket.getObjects to bucket.objects.find with the new specification, only after that, it worked as before again
Hello,
I was using 4.1 for almost 2 years ago, and my site started to crash last week, debugging my code I realized we stopped getting some of the nested data as we were expecting, I suppose there was a change in the cosmicjs api, I have a structure of nested objects in cosmic, something like this
pages -> sections -> videos
, the reason why my site started to crash is because of the data of the last object in my nesting chain was different, I was expecting an object with the whole data, instead of that, I was getting a string with just the id.Before
Before
I updated the package to the latest version and I kept having this issue, this article says there are no breaking changes https://www.cosmicjs.com/changelog/npm-module-updates-v4-2, however, I had to change the implementation from
bucket.getObjects
tobucket.objects.find
with the new specification, only after that, it worked as before again