-1

I'm following Backbase Frontend Essentials course on https://bbacademy.learnupon.com/ - and the task was to generate a data module with RAML (the RAML was provided). I downloaded the provided RAML, followed the tutorial, but when I went to view in the browser my terminal shows the following error:

ERROR in libs/exchange-rate-data/src/exchange-rate-data.service.ts(5,33): error TS2305: Module '"../../../node_modules/@backbase/foundation-ang/data-http/backbase-foundation-ang-data-http"' has no exported member 'HTTP_PARAMS_FACTORY'.
    libs/exchange-rate-data/src/exchange-rate-data.service.ts(5,54): error TS2305: Module '"../../../node_modules/@backbase/foundation-ang/data-http/backbase-foundation-ang-data-http"' has no exported member 'HttpParamsFactory'.

I haven't touched this file. Here is what I have tried:

  1. Checked my Node Version - I'm on v10.18.1 (thought maybe an older version was the culprit) and my angular version is 8.
  2. Ran npm install and npm update to update /node modules
  3. I checked ../../../node_modules/@backbase/foundation-ang/data-http/backbase-foundation-ang-data-http and sure enough did not find HTTP_PARAMS_FACTORY nor HttpParamsFactory
  4. Checked Backbase documentation for HTTP_PARAMS_FACTORY and HttpParamsFactory and its part of foundation-ang/data-http API.

I am new to backbase and think this error is coming from the code I was given in the tutorial but I am not sure. Any help would be appreciated.

1 Answers1

1

I have solved the issue, but not 100% certain if all of the below fixed it or not. This is what I did: Tutorial says to install @backbase/foundation-ang at version 4.25 but that version didn't have the HttpParamsFactory type alias nor the HTTP_PARAMS_FACTORY const which were both referenced in the downloaded Raml spec given in the tutorial. I switched to @backbase/foundation-ang version 4.33.0. I also modified the module file from the provided RAML by importing the HttpClientModule (which the instructor had but I did not by default)and then I modified the provider's array. So my final exchange-rate-data.module.ts file now looks like this:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { InjectionToken, ModuleWithProviders, Optional } from "@angular/core";
import { HttpClientModule } from "@angular/common/http";
import { createServiceDataHttpConfig, DATA_HTTP_CONFIG, DataHttpModule, ServiceDataHttpConfig } from "@backbase/foundation-ang/data-http";
import { EXCHANGE_RATE_DATA_CONFIG, ExchangeRateDataService } from "./exchange-rate-data.service";
export const CONFIG_VALUE = new InjectionToken("ExchangeRateData Data Service :: Custom Http Config");
// export function createExchangeRateDataServiceDataHttpConfig(globalConfig: ServiceDataHttpConfig, serviceConfig?: Partial<ServiceDataHttpConfig>) {
//     return createServiceDataHttpConfig(globalConfig, serviceConfig ? serviceConfig : { "servicePath": "" });
// }
@NgModule({
    declarations: [],
    imports: [
        CommonModule,
        DataHttpModule,
        HttpClientModule
    ],
    providers: [ExchangeRateDataService, {provide: CONFIG_VALUE, useValue: {
        servicePath: '',
    }}, {
        provide: EXCHANGE_RATE_DATA_CONFIG,
        useFactory: createServiceDataHttpConfig,
        deps: [DATA_HTTP_CONFIG, CONFIG_VALUE],
        }]
})