question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update this plugin for Capacitor 3

See original GitHub issue

Capacitor 3 is being built and is already in beta. In this new version the native plugins have been removed from the core and there are some changes that are necessary in the existing plugins.

Example: Plugin Imports The Plugins object is deprecated, but will continue to work in Capacitor 3. Capacitor plugins should be updated to use the new plugin registration APIs (see the Upgrade Guide for plugins), which will allow them to be imported directly from the plugin’s package.

Going forward, the Plugins object from @capacitor/core should not be used.

// OLD
import { Plugins } from '@capacitor/core';
const { AnyPlugin } = Plugins;
Importing the plugin directly from the plugin’s package is preferred, but the plugin must be updated to work with Capacitor 3 for this to be possible.
// NEW
import { AnyPlugin } from 'any-plugin';

References:

Updating Capacitor to 3.0 in your plugin

Updating Capacitor to 3.0 in your app

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

6reactions
Linknpaycommented, May 1, 2021

hello, there is an issue building capacitor 3 with this plugin :

Error: node_modules/@capacitor/core/types/definitions-internal.d.ts:15:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'.
  Types of property 'Plugins' are incompatible.
    Type '{ [pluginName: string]: { [prop: string]: any; }; }' is missing the following properties from type 'PluginRegistry': FirebaseAnalytics

Solution : in file : node_modules/@capacitor-community/firebase-analytics/dist/esm/definitions.d.ts You should delete lines 1 to 5

3reactions
brownoxfordcommented, May 21, 2021

@vanessag Yes, definitely. I’m currently working on the 1.0.0 release that will be compatible with Capacitor 3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating to 3.0 | Capacitor Documentation
The Plugins object is deprecated, but will continue to work in Capacitor 3. Capacitor plugins should be updated to use the new plugin...
Read more >
Update this plugin for Capacitor 3 · Issue #22 - GitHub
Capacitor 3 is being built and is already in beta. In this new version the native plugins have been removed from the core...
Read more >
ionic capacitor update - Ionic Framework
Update Capacitor native platforms and install Capacitor/Cordova plugins with the Ionic Capacitor Update feature. Read to learn more about use and ...
Read more >
Understanding Changes to Capacitor 3 core plugins - Ionic Blog
Updating our App. Let's start off by updating our app to use the latest beta release or Capacitor Core and the CLI. npm...
Read more >
Capacitor 3.0 Upgrade Plugins "not implemented" Exception ...
Both answers are wrong. Capacitor 3 allows android plugins to auto register, but for that you need to remove the init method from ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found