baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

Doesn't compile on strict mode #154

Open mcroker opened 3 years ago

mcroker commented 3 years ago

With strict: true, I'm getting the below compile error...

Error: node_modules/@capacitor/core/dist/esm/core-plugin-definitions.d.ts:27:5 - error TS2411: Property 'CapacitorFirebaseAuth' of type 'CapacitorFirebaseAuthPlugin | undefined' is not assignable to string index type '{ [prop: string]: any; }'.

27     [pluginName: string]: {
       ~~~~~~~~~~~~~~~~~~~~~~~
28         [prop: string]: any;
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29     };
   ~~~~~~

This is resolved by removing the type specification. I know I could unset strict mode, or ignore libs - but both feel like. bad solution.

/* REMOVED TO ALLOW STRICT MODE COMPILE

declare module "@capacitor/core" {
    interface PluginRegistry {
        CapacitorFirebaseAuth?: CapacitorFirebaseAuthPlugin;
    }
}
*/

That said I'm a little confused as it worked this morning...

kasokz commented 3 years ago

I have the same problem, I'm not sure what suddenly caused it. I also have to remove code from the nested @capacitor/core dependency from this one to make it work. No matter how I configure my TypeScript or Angular settings, the error doesn't go away. I'm pretty sure my compiler is configured to ignore nested node_modules during build, but it doesn't work.