capacitor-community / native-market

MIT License
27 stars 16 forks source link

Types of property 'Plugins' are incompatible. Property 'NativeMarket' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'. #17

Closed hsq125 closed 1 year ago

hsq125 commented 1 year ago

Describe the bug Compilation fails with

Error: node_modules/@capacitor/core/types/definitions-internal.d.ts:16:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'.
  Types of property 'Plugins' are incompatible.
    Property 'NativeMarket' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'.

16 export interface CapacitorInstance extends CapacitorGlobal {
                    ~~~~~~~~~~~~~~~~~

  node_modules/@capacitor-community/native-market/dist/esm/definitions.d.ts:3:9
    3         NativeMarket: NativeMarketPlugin;
              ~~~~~~~~~~~~
    'NativeMarket' is declared here.

✖ Failed to compile.

To Reproduce Steps to reproduce the behavior:

  1. Add dependency to package.json
    "@capacitor-community/native-market": "^0.1.4" to your project

  2. Add the import

import {NativeMarket} from '@capacitor-community/native-market';

or, as per documentation

import { Plugins } from '@capacitor/core';
const { NativeMarket } = Plugins;
  1. Use the plugin
    NativeMarket.openStoreListing({
      appId: 'com.burbn.instagram',
    }).then(() => this.updateLater.emit());
  }
  1. Build (ionic build or ionic serve)

  2. See error

Expected behavior Compilation does not fails.

Desktop (please complete the following information):

Additional context

package.json dependencies

  "dependencies": {
    "@angular/common": "^14.0.0",
    "@angular/core": "^14.0.0",
    "@angular/forms": "^14.0.0",
    "@angular/platform-browser": "^14.0.0",
    "@angular/platform-browser-dynamic": "^14.0.0",
    "@angular/router": "^14.0.0",
    "@auth0/angular-jwt": "^5.1.0",
    "@capacitor-community/file-opener": "^1.0.4",
    "@capacitor-community/native-market": "^0.1.4",
    "@capacitor-community/privacy-screen": "^3.0.1",
    "@capacitor/android": "4.4.0",
    "@capacitor/app": "^4.1.1",
    "@capacitor/core": "4.4.0",
    "@capacitor/haptics": "4.0.1",
    "@capacitor/ios": "4.4.0",
    "@capacitor/keyboard": "4.0.1",
    "@capacitor/push-notifications": "^4.1.2",
    "@capacitor/status-bar": "4.0.1",
    "@capacitor/toast": "^4.1.0",
    "@capawesome/capacitor-badge": "^2.0.2",
    "@capawesome/capacitor-file-picker": "^0.5.9",
    "@ionic/angular": "^6.1.9",
    "@ionic/pwa-elements": "^3.1.1",
    "@sentry/angular": "^7.40.0",
    "@sentry/tracing": "^7.40.0",
    "@zxcvbn-ts/core": "^2.2.1",
    "@zxcvbn-ts/language-en": "^2.1.0",
    "amazon-cognito-identity-js": "^6.1.1",
    "angular-password-strength-meter": "^5.0.1",
    "animate.css": "^4.1.1",
    "canvas-confetti": "^1.6.0",
    "capacitor-document-scanner": "^1.0.1",
    "capacitor-ios-autofill-save-password": "^1.1.4",
    "capacitor-native-biometric": "^4.1.3",
    "cordova-res": "^0.15.4",
    "ionicons": "^6.0.3",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
jcesarmobile commented 1 year ago

I've released 4.0.0 with Capacitor 4 support, it should have fixed this issue. Also 5.0.0 with Capacitor 5 support. If the problem is still present, please, create a new issue and provide a sample app that reproduces the issue