-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CodePush causes uncaught exceptions when previewing project on a web browser #40
Comments
You are not supposed to use it on web. something like this
|
I know that. But simply importing the plugin, registering it, causes the exception. On the contrary, other Capacitor or Cordova plugins catch these exceptions. We should mimic that behavior for this plugin. |
Perhaps doing something like this would be acceptable ? let codePushInstance: CodePush | null = null;
if(Capacitor.getPlatform() !== 'web') {
codePushInstance = new CodePush();
(window as any).codePush = codePushInstance;
} else {
/* Can't use CodePush without Capacitor */
/* The instance will be null */
}
export const codePush: CodePush | null = codePushInstance; The downside is that the nullish case should be managed by the developer usign this package. |
Signed-off-by: Clovis Durand <[email protected]>
Description
When debugging or developing an app using a web browser (for example for styling development), CodePush throws an uncaught exception that does not come from the app's source code.
Additional Information
This issue does not happen with other Capacitor plugins that are "mobile-only". A good example is the Firebase notification plugin.
Screenshots
Exception :
Code extract :
The text was updated successfully, but these errors were encountered: