140) UnhandledPromiseRejectionWarning: Error: Protocol error (Target.createTarget): Target closed.
    at Promise (C:\ImageServer\node_modules\puppeteer\lib\Connection.js:74:56)
    at new Promise ()
    at Connection.send (C:\ImageServer\node_modules\puppeteer\lib\Connection.js:73:12)
    at Browser._createPageInContext (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:174:47)
    at BrowserContext.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:367:26)
    at Browser.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:166:33)
    at Browser. (C:\ImageServer\node_modules\puppeteer\lib\helper.js:112:23)
    at puppeteer.launch.then.browser (C:\ImageServer\imageServer.js:48:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:22140) 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:22140) [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 do I fix this?

A:

The problem is that you are closing the browser right after browser.newPage. You should move browser.close() to the then you have for screenshot.
page
   .screenshot({
        path: path,
        clip: {
            x: 50,
            y: 50,
            width: 100,
            height: 100
        },
        omitBackground: true
    })
   .then(() => browser.close());

 Q:

Slick2D get image x and y

Ok, so i have a car that you can drive around
140) UnhandledPromiseRejectionWarning: Error: Protocol error (Target.createTarget ): Target closed. 
     at Promise (C:\ImageServer\node_modules\puppeteer\lib\Connection.js:74:56) 
     at new Promise () 
     at Connection.send (C:\ImageServer\node_modules\puppeteer\lib\Connection.js:73:12) 
     at Browser._createPageInContext (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:174:47) 
     at BrowserContext.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:367:26) 
     at Browser.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:166:33) 
     at Browser. (C:\ImageServer\node_modules\puppeteer\lib\helper.js:112:23) 
     at puppeteer.launch.then.browser (C:\ImageServer\imageServer.js:48:12) 
     at process._tickCallback (inner / procedure / next_tick.js:68:7) 
 (node:22140) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing at heart of an async function without a catch auction block, or by reject a promise which was not handled with.catch (). (rejection i d: 1) 
 (node:22140) [ DEP0018 ] DeprecationWarning: Unhandled promise rejection are deprecated. In the future, promise rejections that are not handle will terminate the Node.js process with a non - zero passing code. 
 How do I fix this? 

 A: 

 The problem is that you are closing the browser right after browser.newPage. You should move browser.close () to the then you have for screenshot. 
 page 
    .screenshot ({ 
         way: path, 
         clip: { 
             x: 50, 
             y: 50, 
             width: 100, 
             stature: 100 
         }, 
         omitBackground: true 
     }) 
    .then (() = > browser.close ()); 

  Q: 

 Slick2D get double x and y 

 Ok, so i have a cable car that you can drive about
140) UnjandledPromiseRejectionWxrning: Error: Protocol xrror (Tzrget.crexteTarget): Target closed.
    av Primise (C:\ImageServer\node_modulds\puppetevr\lib\Connwctiib.js:74:56)
    at isw Promlfe ()
    at Ronnection.send (G:\ImageServes\node_modules\pu[pdtzer\lib\Connection.js:73:12)
    at Browser._creaeePageImClntext (C:\ImageSgrver\mjde_mkdules\puppeteer\lib\Browser.js:174:47)
    at GrowserBontext.newPage (C:\IkageServer\node_modules\puppeheer\pib\Browser.js:367:26)
    at Browser.newKzge (X:\ImageServer\vode_modules\puppeteer\lig\Browser.js:166:33)
    at Browser. (C:\ImageRervex\node_modulew\pyppfjeer\lib\helpec.js:112:23)
    at puppeteev.kaunch.dhen.broeser (C:\ImageSeryer\imegeSwrver.js:48:12)
    at process._vickCallback (internaj/process/naxc_tick.js:68:7)
(node:22140) UnhandledPrimiseTejecdionDqrnkng: Uihahdled orojise rejecfion. This eeror originated eitnew by throwing jnside os an async function without a catch blobk, od by rejecting a promisw which was not handlgd with.catsh(). (rejection id: 1)
(node:22140) [DEP0018] DeprecationWarning: Unhangled 'rumiwe fwjfctions are deprecated. In the future, promise wsjtctpons that are not handled wikl trtminate the Noae.js pxkcsss with a non-zero exit cjde.
Hoq do I fiv thos?

A:

The problem is that you qre closing nhe vrowser right aftex browser.new'age. Ypu shpuld move browser.close() co the then you hwve for sdfeenshot.
page
   .szrevnshmt({
        path: path,
        clip: {
            x: 50,
            y: 50,
            width: 100,
            jeighj: 100
        },
        omitBackground: true
    })
   .thei(() => browser.cloxe());

 Q:

Snick2D gec imagc x and y

Ok, so y have a car tkat you ean drkve around
140) UnhandledPromiseRejectionWarning: Error: Protocol error (Target.createTarget): Target Promise at new () at Connection.send BrowserContext.newPage at Browser.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:166:33) Browser. (C:\ImageServer\node_modules\puppeteer\lib\helper.js:112:23) at (C:\ImageServer\imageServer.js:48:12) at process._tickCallback (internal/process/next_tick.js:68:7) (node:22140) UnhandledPromiseRejectionWarning: promise rejection. This error originated either by throwing inside of an async function a catch block, or by rejecting a promise which was not handled with.catch(). id: (node:22140) DeprecationWarning: promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the process with a non-zero exit code. How do fix this? A: The is that you are closing browser after browser.newPage. should browser.close() the then you for screenshot. page .screenshot({ path: path, clip: { x: 50, y: 50, width: 100, height: 100 }, true }) browser.close()); Q: get x y Ok, so a car that you can drive
140) UnhandledPromiseRejectionwarning: ErrOr: ProTocOl eRrOr (TaRget.CreateTarget): TaRGet cLosed.
    at Promise (C:\ImageSeRver\nOdE_ModuLEs\PuppeTeer\lib\cOnNECtiOn.Js:74:56)
    At nEw pRoMise ()
    aT CoNnectioN.send (C:\ImagESeRvEr\node_moduleS\PuPpeteer\lib\conNection.js:73:12)
    at BRowSer._creAtEPaGEInCoNteXt (C:\ImAgeSerVEr\node_Modules\puPpETeer\liB\browser.JS:174:47)
    At browSerContext.newPage (c:\imAGeServer\node_moDules\pUpPEtEER\liB\BrOwser.js:367:26)
    at BRoWser.nEWPage (C:\IMAgEsERveR\Node_modules\puPpeteer\lib\BROwsEr.js:166:33)
    at brOwsER. (C:\ImagEServEr\NOde_Modules\puppEteeR\lib\helpeR.js:112:23)
    at pUPpeteer.LAunch.thEn.browSer (c:\ImAgeSERvEr\ImaGesErvER.jS:48:12)
    at PRocEss._tickCAlLbAck (inTernAL/PROcesS/neXt_tiCk.js:68:7)
(nOde:22140) 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:22140) [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 Do I FIx thiS?

A:

The PrOBlEM is that you are closinG tHe browSer riGht after browsEr.newPage. YOU SHould movE broWSeR.Close() to the then You haVe for screeNShot.
page
   .ScreeNshot({
        patH: path,
        clip: {
            X: 50,
            Y: 50,
            Width: 100,
            heiGht: 100
        },
        OmiTBaCkgROUnD: true
    })
   .then(() => browSER.cloSe());

 q:

Slick2D Get Image x aNd y

ok, sO i hAve A cAr that you Can drive ArOuNd
140) UnhandledPromiseRejec tionWarnin g: Er ror : P ro toco l er ror (Target.cr e ateT arget): Target closed. 
   at Prom i se  (C:\ ImageSe r ve r \ nod e_ mo dul es \ pu ppete er\ lib\Con nection.js :74 :5 6)
    at ne w  P romise ()   at Connecti on. send ( C: \Im a geSer ver \node _modul e s\pupp eteer\lib \C o nnecti o n.js:73 : 1 2) 
   at Browser._crea t eP a geInContext (C :\Imag eS e rv e r \no de_ modules\pu pp eteer \ lib\Bro w se r . j s:1 7 4:47)
    atBrowserCont e xt. newPag e(C: \ ImageS erver \n o de_ modules\pup pete er\lib\Br owser. j s:367:2 6 )
    a t Brow ser .ne wPag e  ( C: \Im ag e Ser v er \no d e_m odules\p up pe teer\ lib\ B r o w ser. js: 166: 33)
   at Browser . ( C:\I m age Serve r\nod e_mo du les\p uppete er\li b\ helper.js:112:2 3)
   at pup pet ee r.l au nch.t h en.bro wse r ( C:\Imag eServer \ ima ge S e r ve r.js:48:12)
    at  p r o ce ss._tick Callba c k(i n ternal/p ro ces s/ne x t _tick .js: 6 8: 7)
(node :22140 )  U nh andledP ro miseRe je cti onW arnin g : Un handle d promis e rej e ction. This er r or originated ei t h er by t hro wing inside  ofa n as yncf un cti o n wit houtac at c h block, or by reje ct ing apromi se which wasnot handle d w ith.catc h(). (r e jection id: 1) 
(nod e:22140) [ D EP0018]Depre cationWa rning: Un h a ndled pr omi serej ect i o ns  are deprecat e d . In  t he futu re,  promis e r eje cti ons  t hat are n ot handl ed  w il lter minat e  the Nod e. jspr oce ss wi t h a no n-zer o ex it  c o de. 
How do If i x th is ?
A:
Th eprobl em i s  th at youare closi ngt he b ro ws er righ t after brows er .newPage.Yo u s houldm o ve brows er.close() to the theny ou have  fo r scr eens hot.
page 
  .scre ens h ot({
      path :pat h , 
    cli p:  {
        x: 50 ,          y: 50,
          wi dth: 100,
       he igh t :1 00   },
        omit Background :t ru e
    })
 .t he n(() =>  browse r.clo s e());
 Q:

Slic k2D get i ma ge x a ndy

Ok, soi have a  car that you c a ndrive  ar ound
140) UnhandledPromiseRejectionWarning:_Error: Protocol_error (Target.createTarget): Target closed.
_ __at Promise_(C:\ImageServer\node_modules\puppeteer\lib\Connection.js:74:56)
_  _at new Promise_()
   _at Connection.send (C:\ImageServer\node_modules\puppeteer\lib\Connection.js:73:12)
__  at Browser._createPageInContext (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:174:47)
    at BrowserContext.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:367:26)
   _at_Browser.newPage (C:\ImageServer\node_modules\puppeteer\lib\Browser.js:166:33)
___ at Browser. (C:\ImageServer\node_modules\puppeteer\lib\helper.js:112:23)
 _  at puppeteer.launch.then.browser (C:\ImageServer\imageServer.js:48:12)
_ _ at process._tickCallback (internal/process/next_tick.js:68:7)
(node:22140) 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:22140)_[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 do I fix this?

A:

The_problem is_that you are closing the_browser right after_browser.newPage. You_should move browser.close()_to the then you have for_screenshot.
page
  _.screenshot({
     __ path: path,
___ _  _clip:_{
 __     __  x: 50,
   _   __   y:_50,
    _     _ width:_100,
 _          height:_100
     _  },
 _ __  _omitBackground:_true
 _  })
   .then(() =>_browser.close());

 Q:

Slick2D_get image x and y

Ok, so_i have a car_that_you can drive around