SEBASTIAN FERNANDEZ
SEBASTIAN FERNANDEZ

Reputation: 58

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

Upvotes: 1

Views: 329

Answers (2)

Krzysztof Platis
Krzysztof Platis

Reputation: 1221

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

Upvotes: 1

SEBASTIAN FERNANDEZ
SEBASTIAN FERNANDEZ

Reputation: 58

So the origin of the error was that in the GET /pages request I was not receiving the context attribute neither in the LanguageComponent nor the CurrencyComponent.

enter image description here

Upvotes: 0

Related Questions