Hello,
I’m trying to upgrade the delivery API from 0.9 to 1.0.
I’m using react on the frontend and BloomreachXM 14.7.
I am currently using “bloomreach/react-sdk”: “18.0.1” and it has “@bloomreach/spa-sdk”: “18.0.1” as a transitive dependency.
After updating the default pagemodelapi version to 1.0 in hst-config.properties I’m able to see the new API response format when I call for /resourceapi/ , but I’m also seeing errors in the devtools console:
Uncaught Error: Unsupported component type: ‘undefined’.
at ComponentFactory.buildComponent (component-factory09.ts:68:1)
at ComponentFactory.create (component-factory09.ts:55:1)
at new PageImpl (page09.ts:84:1)
These errors are happening in files coming from @bloomreach/spa-sdk package.
After looking through the code from the package the issue seems to be related to the component types being changed in the API response between the two API versions from uppercase format ‘CONTAINER_ITEM_COMPONENT’ to lowercase ‘container-item’.
I can see the difference when I compare the delivery api response:
0.9: “type”: “CONTAINER_COMPONENT”,
1.0: “type”: “container”,
I think somehow the wrong files are being used as I see component09.ts, component-factory09.ts being hit when it should be component.ts, component-factory.ts as those have the correct type casing.
I think the issue may also be related to page-factory.ts where I see this line:
export type PageFactory = Builder<[PageModel | PageModel09], Page>;
Is the Delivery API 1.0 compatible with my sdk version? Is there a configuration I’m not setting up properly?
Thank you!