nomadreservations / ngx-stripe

Angular 8.x wrapper for StripeJS
41 stars 32 forks source link

NgModule import issue in Angular 9+ #38

Open HardikDG opened 4 years ago

HardikDG commented 4 years ago

I have integrated this in Angular 9 project. It is showing this error in console:

ERROR in node_modules/ngx-stripe/lib/ngx-stripe.module.d.ts:4:65 - error NG6005: NgxStripeModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

4     static forRoot(publishableKey?: string, options?: Options): ModuleWithProviders;

Any idea what can be the solution?

I have added like: as shown in readme

imports: [
    BrowserModule,
    NgxStripeModule.forRoot('pk_test_xxxxx'),
    AppRoutingModule
  ],

My configuration is:

Node: 13.11.0 OS: darwin x64

Angular: 9.0.7 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.900.7 @angular-devkit/build-angular 0.900.7 @angular-devkit/build-optimizer 0.900.7 @angular-devkit/build-webpack 0.900.7 @angular-devkit/core 9.0.7 @angular-devkit/schematics 9.0.7 @ngtools/webpack 9.0.7 @schematics/angular 9.0.7 @schematics/update 0.900.7 rxjs 6.5.4 typescript 3.7.5 webpack 4.41.2

JacobTheJacobs commented 4 years ago

try ng update @angular/cli @angular/core

paullryan commented 4 years ago

I have this integrated and working on my angular 9 with ivy projects so not sure what's going on, I'm currently running angular 9.1+ might want update.