capacitor-community / facebook-login

Facebook Login support
MIT License
103 stars 54 forks source link

Type definitions not loaded #39

Closed dminkovsky closed 3 years ago

dminkovsky commented 3 years ago

Describe the bug I see that definitions.ts extends PluginRegister:

declare module '@capacitor/core' {
    interface PluginRegistry {
        FacebookLogin: FacebookLoginPlugin;
    }
}

However, for some reason, when I import this module and then import {Plugins} from @capacitor/core, Plugins.FacebookLogin is any.

Do you have any debugging advice? Here is my tsconfig:

{
    "exclude": ["node_modules"],
    "include": [
        "node_modules/@capacitor-community/facebook-login/dist/esm/definitions.d.ts"
    ],
    "compilerOptions": {
        "noEmit": true,
        "jsx": "react",
        "esModuleInterop": true,
        "types": [],
        "lib": ["DOM", "DOM.Iterable", "ESNext"],
        "target": "ES6",
        "module": "ESNext",
        "moduleResolution": "node",
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "resolveJsonModule": true,
        // Specified because required by `paths` setting below
        "baseUrl": "."
    }
}

You can see I tried adding it explicitly to includes, but no luck. Generally, though, adding it to include is only necessary if it's not being explicitly imported, at least that is my understanding and has been working for me. Am I missing something?

Thanks a lot for this module.

To Reproduce No reproduction, just seeking troubleshooting advice if anything comes to mind. Please close this issue if nothing comes to mind.

Expected behavior When I import the module, types should be read by the TypeScript compiler.

Screenshots N/A

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

dminkovsky commented 3 years ago

Actually here is a very minimal version that works with my exact tsconfig: https://codesandbox.io/s/restless-wood-r53v1?file=/src/index.tsx. Closing this issue, but if anyone has any ideas I would really appreciate it :) Thank you.