rubenCodeforges / ng-gapi

ng-gapi a Google api module for Angular 6+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoogleApiModule is not compatibile with Ivy

dwlizlo opened this issue · comments

Library is not compatible with Angular 9

This likely means that the library (ng-gapi) which declares GoogleApiModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

2 export declare class GoogleApiModule {

Duplicate of #96

This is the error which it throws... I have updated to 0.0.93

Function calls are not supported in decorators, but 'Google api module was called'... It is not working again

@hariraghupathy im using a clean project and i dont get this , can you show how you are using the lib ?

import { MaterialModule } from './material.module';
import { AuthService } from './Modules/auth/Service/auth.service';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AuthModule } from './Modules/auth/auth.module';
import { HttpClientModule } from '@angular/common/http';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { UserService } from './Modules/auth/Service/user-service.service';
import { GoogleApiModule, NG_GAPI_CONFIG, NgGapiClientConfig } from 'ng-gapi/lib/src';
import { LoginPageComponent } from './Modules/auth/View/LoginView/login-page/login-page.component';
let gapiClientConfig: NgGapiClientConfig = {

client_id: "yourclientid",
discoveryDocs: ["https://analyticsreporting.googleapis.com/$discovery/rest?version=v4"],
ux_mode: "popup",
redirect_uri: "yourredirecturi",
scope: [
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file"

].join(" ")
};

@NgModule({
declarations: [
AppComponent,
LoginPageComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
HttpClientModule,
MaterialModule,
ReactiveFormsModule,
FormsModule,
GoogleApiModule.forRoot({
provide: NG_GAPI_CONFIG,
useValue: gapiClientConfig
}),
// AuthModule
],
providers: [AuthService,UserService],
bootstrap: [AppComponent]
})
export class AppModule { }

this is my app.module, so when aot is false and build optimizer is false, only then it can be built for production

@hariraghupathy and how do you use it ?
And can you show your package json

import { GoogleApiService } from 'ng-gapi/lib/src';
import { AngularFireAuth } from '@angular/fire/auth';
import { GoogleAuthService } from 'ng-gapi/lib/src';
import { environment } from 'src/environments/environment';
import * as firebase1 from 'firebase';

constructor(public service: AuthService, public errorMessages: ErrorMessageService,private userService: UserService,
// private sheetResource: SheetResource,
private route: ActivatedRoute,
private authService: GoogleAuthService,
private gapiService: GoogleApiService,
// private DriveResource:DriveResource,
private firebase:AngularFireAuth) {
this.gapiService.onLoad().subscribe();
firebase1.initializeApp(environment.firebaseConfig);
}

@rubenCodeforges thank you very much ... a fresh project made it work... but i dont know why my previous project dint resolve... might be cleaning the cache would have helped