Issue upgrading to CIF components 2.4.2
I work on a site that was using version 1.9.0 of CIF components and we are trying to move to 2.4.2
Once some dependencies were resolved the site is running but all components fail with a JS error "The commerce API is not properly initialized. A required property is missing from the initialization object"
Looking at the code this is what I'm seeing:
var t = document.querySelector('meta[name="store-config"]');
if (t)
window.CIF.CommerceGraphqlApi = new l(JSON.parse(t.content));
else {
var n = document.body.dataset
, r = n.storeView
, e = n.graphqlEndpoint
, i = n.graphqlMethod
, o = n.httpHeaders;
window.CIF.CommerceGraphqlApi = new l({
graphqlEndpoint: e,
storeView: r,
graphqlMethod: i,
headers: o ? JSON.parse(o) : {}
})
}
The code is entering in the else branch but there's no dataset on the body tag so it fails. The CIF configuration and the com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl.cfg are correctly set as they were before.
Who is responsible of setup the data on body tag?
Thanks