title: NodeJS Puppeteer Error in Windows Docker but not Windows10
body: <p>I could print PDF successfully when I am running on Windows10 <code>node puppeteer.js</code> directly. However, when I pushed to Windows Docker, I faced below error:</p>
  
  <pre><code>[2019-10-23T05:10:53.160Z] Puppeteer Error:
  Error: Page crashed!
      at Page._onTargetCrashed (C:\App\node_modules\puppeteer\lib\Page.js:215:24)
      at CDPSession.&lt;anonymous&gt; (C:\App\node_modules\puppeteer\lib\Page.js:123:56)
      at CDPSession.emit (events.js:210:5)
      at CDPSession._onMessage (C:\App\node_modules\puppeteer\lib\Connection.js:200:12)
      at Connection._onMessage (C:\App\node_modules\puppeteer\lib\Connection.js:112:17)
      at WebSocket.&lt;anonymous&gt; (C:\App\node_modules\puppeteer\lib\WebSocketTransport.js:44:24)
      at WebSocket.onMessage (C:\App\node_modules\ws\lib\event-target.js:120:16)
      at WebSocket.emit (events.js:210:5)
      at Receiver.receiverOnMessage (C:\App\node_modules\ws\lib\websocket.js:789:20)
      at Receiver.emit (events.js:210:5)
  [2019-10-23T05:10:53.370Z] Error for printPdf()
  Error: Protocol error (Runtime.callFunctionOn): Target closed.
      at C:\App\node_modules\puppeteer\lib\Connection.js:183:56
      at new Promise (&lt;anonymous&gt;)
      at CDPSession.send (C:\App\node_modules\puppeteer\lib\Connection.js:182:12)
      at ExecutionContext._evaluateInternal (C:\App\node_modules\puppeteer\lib\ExecutionContext.js:107:44)
      at ExecutionContext.evaluateHandle (C:\App\node_modules\puppeteer\lib\ExecutionContext.js:57:17)
      at ExecutionContext.&lt;anonymous&gt; (C:\App\node_modules\puppeteer\lib\helper.js:112:23)
      at WaitTask.rerun (C:\App\node_modules\puppeteer\lib\DOMWorld.js:570:65)
      at processTicksAndRejections (internal/process/task_queues.js:93:5) {
    message: 'Protocol error (Runtime.callFunctionOn): Target closed.'
  }
  </code></pre>
  
  <p>Supplement Versions:</p>
  
  <blockquote>
    <p><strong>Chrome/Chromium:</strong><br>
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3865.120 Safari/537.36  </p>
    
    <p><strong>Windows:</strong><br>
    1903 or  10.0.18362 N/A Build 18362  </p>
    
    <p><strong>NodeJS packages:</strong><br>
    adal-node@0.2.1<br>
    azure-keyvault@3.0.5<br>
    azure-sb@0.11.1<br>
    azure-storage@2.10.3<br>
    http@0.0.0<br>
    puppeteer@1.20.0<br>
    puppeteer-core@1.20.0  </p>
  </blockquote>
  
  <p>Traced the error is from :</p>
  
  <pre><code>await page.waitForFunction(() =&gt; !!(window.Ext), {
      polling: LOAD_POLLING,
      timeout: LOAD_TIMEOUT
  });
  
  log('Building document ...'); // this line okay to print out
  
  await page.waitForFunction(() =&gt; !!(Ext.isReady), {
      polling: LOAD_POLLING,
      timeout: LOAD_TIMEOUT
  });
  </code></pre>