Skip to content

Custom plugin 'No web implementation' unless registerWebPlugin manually called in/after app constructor #1985

Answered by Timeswitch
Cloov asked this question in Q&A
Discussion options

You must be logged in to vote

You can also just import your plugin inside your app.

import 'my-awesome-plugin';
import { Plugins } from '@capacitor/core';


function SomewhereInYourApp()
{
   const {MyAwesomePlugin} = Plugins;
   MyAwesomePlugin.doStuff();
 
}

If you don't import your Plugin, registerWebPlugin won't get called, so the registry doesn't know there is a web implementation.
The reason you native implementations work, is because they get picked up by capacitors auto-binding.

Edit:

Removed my old answer to avoid confusion.

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mlynch
Comment options

Answer selected by mlynch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #1985 on June 09, 2020 21:03.