Solution
{
provide: StoreFinderAdapter,
useClass: ThmOccStoreFinderAdapter
}
Explanation
For the token StoreFinderAdapter
, Spartacus OOTB passes the OccStoreFinderAdapter
via useClass
(but not via useExisting
):
{
provide: StoreFinderAdapter,
useClass: OccStoreFinderAdapter
}
Therefore OccStoreFinderAdapter
is not an injectable and cannot be custom-provided. It was just used as a raw implementation of the abstract StoreFinderAdapter
Note: If StoreFinderAdapter
was provided with OccStoreFinderAdapter
via useExisting
and the OccStoreFinderAdapter
was provided itself as an injectable (i.e. in the root injector: @Injectable({providedIn: 'root'})
), then your code would work as you expected:
{
provide: OccStoreFinderAdapter,
useClass: ThmOccStoreFinderAdapter
}