Skip to content
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

Unhandled Promise Rejection Warning #53

Open
ShwetaKhera opened this issue Apr 9, 2018 · 1 comment
Open

Unhandled Promise Rejection Warning #53

ShwetaKhera opened this issue Apr 9, 2018 · 1 comment

Comments

@ShwetaKhera
Copy link

I ran the command " cordova plugin add cordova-plugin-video-player " and gives me the following error:

(node:4008) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): Error: cmd: Command failed with exit code ENOENT
(node:4008) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.

command " ionic info " shows :

cli packages: (C:\Users\shweta\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.0.1
Node              : v9.2.0
npm               : 5.8.0
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Users\shweta\AppData\Local\Android\sdk

Misc:

backend : pro

Please help me out.

@vancepope
Copy link

Video player returns a promise, so you need to catch it.
async playVideo(){ try{ await this.videoPlayer.play(url); console.log("Video is complete"); } catch(e){ console.error(e); } }
This gets rid of the Unhandled promise rejections for me, hope this helps if you haven't solved it already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants