richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

NgxStripeModule.forRoot returns a ModuleWithProviders type without a generic type argument. #89

Closed admintome closed 4 years ago

admintome commented 4 years ago

Is this a feature request or a bug report?

Bug Report

What's gone wrong?

After a fresh app creation with routing, this error is shown:

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;
                                                                      ~~~~~~~~~~~~~~~~~~~
    src/app/app.component.html:416:25 - error NG8002: Can't bind to 'ngSwitch' since it isn't a known property of 'div'.

    416   <div class="terminal" [ngSwitch]="selection.value">
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/app/app.component.ts:5:16
        5   templateUrl: './app.component.html',
                         ~~~~~~~~~~~~~~~~~~~~~~
        Error occurs in the template of component AppComponent.
    src/app/app.component.html:534:1 - error NG8001: 'router-outlet' is not a known element:
    1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
    2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

    534 <router-outlet></router-outlet>
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/app/app.component.ts:5:16
        5   templateUrl: './app.component.html',
                         ~~~~~~~~~~~~~~~~~~~~~~
        Error occurs in the template of component AppComponent.

Date: 2020-05-10T06:18:04.974Z - Hash: 62cb669989fbb9b23685
5 unchanged chunks

Time: 940ms
: Compiled successfully.

    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;
                                                                      ~~~~~~~~~~~~~~~~~~~
    src/app/app.component.html:416:25 - error NG8002: Can't bind to 'ngSwitch' since it isn't a known property of 'div'.

    416   <div class="terminal" [ngSwitch]="selection.value">
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/app/app.component.ts:5:16
        5   templateUrl: './app.component.html',
                         ~~~~~~~~~~~~~~~~~~~~~~
        Error occurs in the template of component AppComponent.
    src/app/app.component.html:534:1 - error NG8001: 'router-outlet' is not a known element:
    1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
    2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

    534 <router-outlet></router-outlet>
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      src/app/app.component.ts:5:16
        5   templateUrl: './app.component.html',
                         ~~~~~~~~~~~~~~~~~~~~~~
        Error occurs in the template of component AppComponent.

What was meant to happen?

Steps to reproduce

Other information

battulasurendra commented 4 years ago

I have same issue, when I am importing NgxStripeModule all other modules are not working.

richnologies commented 4 years ago

A new version 9.0.3 has been published to NPM that should solve this issue