Cordova build android:failed , what to do - node.js

i have used this from nodejs cli
cordova build android
it gives me this eror :-
(node:3352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i cant detect whats wrong i am making a very basic hello world App
here is the code of my app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
</style>
<body>
<h1>Hello World</h1>
</body>
</html>

Related

Deprecation Warning Error with Blockchain

I'm trying to construct hyperledger fabric blockchain application. When I want to wake up the blockchain with npm:npm run env:restart, I get the following error:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Errors found in script, stopping execution
(node:4432) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
How can i fix this?
my nvm version: 5.6.0
my nodejs version: 8.16.0
You are missing a catch block in a promise chain in your code.
Add it like this:
var p1 = new Promise(function(resolve, reject) {
throw new Error('Uh-oh!');
});
p1.catch(function(e) {
console.log(e); // "Uh-oh!"
});
For more information on Promises and catch block specifically, refer MDN.

Selenium-WebDriver UnhandeledPromiseRejectionWarning Error

This is my first time using Selenium web driver. I am having issues 'getting' a web address. Here is my code:
const {Builder, By, Key, until} = require('selenium-webdriver'),
app = require('express'),
express = app();
let driver = new Builder().forBrowser('chrome').build();
driver.get('https://google.com'); //<---- known bug(doesn't open proper page)
So there, I am just trying to open google.com Please tell me what I'm doing wrong. Anyway, here's the error when I do, node app.js:
DevTools listening on ws://127.0.0.1:12825/devtools/browser/cd5a8eae-4ff0-482e-9f80-cf49f4c3f794
(node:11584) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"A07868DB3EACD45E5235CB0DA6162B30","isDefault":true,"type":"default"},"id":1,"name":"","origin":"://"}
(Session info: chrome=70.0.3538.110)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64)
at Object.checkLegacyResponse (C:\Users\Ben Levy\Desktop\bot\node_modules\selenium-webdriver\lib\error.js:585:15)
at parseHttpResponse (C:\Users\Ben Levy\Desktop\bot\node_modules\selenium-webdriver\lib\http.js:533:13)
at Executor.execute (C:\Users\Ben Levy\Desktop\bot\node_modules\selenium-webdriver\lib\http.js:468:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:11584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11584) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Thanks!
From the error
(Session info: chrome=70.0.3538.110)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.3 x86_64)
I can see it running old chromedriver 2.9 and not compatible with the Chrome, download the latest version from here.

(node:13606) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object] - Ionic Framework

I'm working with the Ionic Framework in its 3rd version, and when I run ionic cordova build --release android, I get this error :
(node:13791) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
(node:13791) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Other threads about this didn't lead me anywhere. Please help
my first attempt would be to check my code for an unhandled promise rejection.
How can i dectect a unhandled promise rejection?
assuming we have a code like this:
asyncAction.then(success => {
// do stuff with the result of success
})
so if the asyncActions fails, there is an unhandled promise rejection because we never catch the rejection of the promise. To catch the rejection we need to do this:
asyncAction.then(success => {
// do stuff with the result of success
}, rejection => {
// handle action failed
})
I solved my problem downgrading cordova version to 7.1.0

"Unhandled promise rejection" error when installing ionic 2 plugins

I get the following error during installation of the Cordova OneSignal plugin:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I couldn't find any solutions on Google.

how to get the #layout functionality of laravel working?

i am new to laravel an trying to learn BLADE but there is a issue which is striking me.
i have an
index.blade.php
#layout('master')
and i also have a
master.blade.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Laravel: A Framework For Web Artisans</title>
<meta name="viewport" content="width=device-width">
</head>
<body>
hi from body
</body>
</html>
the problem is that when ever i try to call the index.blade.php it gives me a
error saying
Unhandled Exception
Message:
View [master] doesn't exist.
Location:
C:\xampp\htdocs\laravel-laravel2\laravel\view.php on line 170
Stack Trace:
#0 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(107): Laravel\View->path('master')
#1 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(218): Laravel\View- >__construct('master', Array)
#2 C:\xampp\htdocs\laravel-laravel2\laravel\helpers.php(526): Laravel\View::make('master', Array)
#3 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(386) : eval()'d code(2): view('master')
#4 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(386): eval()
#5 C:\xampp\htdocs\laravel-laravel2\laravel\blade.php(71): Laravel\View->get()
#6 [internal function]: Laravel\Blade::Laravel\{closure}(Object(Laravel\View))
#7 C:\xampp\htdocs\laravel-laravel2\laravel\event.php(199): call_user_func_array(Object(Closure), Array)
#8 C:\xampp\htdocs\laravel-laravel2\laravel\event.php(138): Laravel\Event::fire('laravel.view.en...', Array, true)
#9 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(348): Laravel\Event::until('laravel.view.en...', Array)
#10 C:\xampp\htdocs\laravel-laravel2\laravel\view.php(590): Laravel\View->render()
#11 C:\xampp\htdocs\laravel-laravel2\laravel\response.php(268): Laravel\View->__toString()
#12 C:\xampp\htdocs\laravel-laravel2\laravel\laravel.php(180): Laravel\Response->render()
#13 C:\xampp\htdocs\laravel-laravel2\public\index.php(34): require('C:\xampp\htdocs...')
#14 {main}
I had the same problem. It may be an error on your part, or may be down to your environment. Either way, try these three things:
Put #layout('master') right at the top of your php file - no white
space.
Make sure your master view is labelled master.blade.php - no
capitals.
Make sure master.blade.php is in application/views
Note: If you have your master view in a different folder e.g. application/views/some_folder the correct way to call it is #layout('some_folder.master')
Use
#extends('master') instead of #layout('master')

Resources