Search code examples
angulartypescriptfacebook-javascript-sdk

export 'AuthServiceConfig' was not found in 'angularx-social-login' in Angular 9 app


I tried to do this documentation: https://levelup.gitconnected.com/sign-in-with-facebook-oauth-in-angular-8-3a1625eceab2

this is my app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { MaterialModule } from './material-module';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LoginComponent } from './components/login/login.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { SignUpComponent } from './components/sign-up/sign-up.component';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { PopUpComponent } from './components/pop-up/pop-up.component';
import { SocialLoginModule, AuthServiceConfig, FacebookLoginProvider } from 'angularx-social-login';

const config = new AuthServiceConfig ([
  {
    id: FacebookLoginProvider.PROVIDER_ID,
    provider: new FacebookLoginProvider('646908969284899')
  }
]);
export function provideConfig() {
  return config;
}

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    SignUpComponent,
    PopUpComponent
  ],
  imports: [
    BrowserAnimationsModule,
    MaterialModule,
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ReactiveFormsModule,
    FlexLayoutModule,
    HttpClientModule,
    HttpClientJsonpModule,
    SocialLoginModule
  ],
  providers: [
    {
      provide: AuthServiceConfig,
      useFactory: provideConfig
    }
   ],
  bootstrap: [AppComponent]
})
export class AppModule { }

I ran this command: npm install --save angularx-social-login I get this error:

Module '"../../node_modules/angularx-social-login/angularx-social-login"' has no exported member 'AuthServiceConfig'.ts(2305)

Anyone know what the solution is?


Solution

  • What are your angular and angularx-social-login versions?

    I think it's a guide for an old version. You can follow this: Angular 9 / 10 Social Login