Search code examples
spartacus-storefront

ERROR TypeError: Cannot read property '__source' of undefined


Since I upgrade to the new spartacus version (1.5) I've seen this bug in the console. It's came from SiteContextComponentService.getInjectedService.

I have not implemented nor used yet this service. How I can fix this bug? Cause I strongly believe is the origin of other little problems in my develop environment.

enter image description here


Solution

  • If you use 'CMSSiteContextComponent' component type (flextype?), then it should come with the context cms component data from the backend. Please check if the response contains it.

    network chrome tab with the response the cms /pages endpoint