Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Windows Docker中的NodeJS傀儡程序错误,但不是Windows 10_Node.js_Docker_Window_Puppeteer - Fatal编程技术网

Node.js Windows Docker中的NodeJS傀儡程序错误,但不是Windows 10

Node.js Windows Docker中的NodeJS傀儡程序错误,但不是Windows 10,node.js,docker,window,puppeteer,Node.js,Docker,Window,Puppeteer,当我直接在Windows10node puppeter.js上运行时,我可以成功打印PDF。然而,当我推到Windows Docker时,我遇到了以下错误: [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.<anon

当我直接在Windows10
node puppeter.js
上运行时,我可以成功打印PDF。然而,当我推到Windows Docker时,我遇到了以下错误:

[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.<anonymous> (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.<anonymous> (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 (<anonymous>)
    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.<anonymous> (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.'
}

检查所有内容是否相同(windows、chrome、Puppeter的版本)Hi@LinPy,添加版本以供参考,并检查它们是否在相同版本中。
await page.waitForFunction(() => !!(window.Ext), {
    polling: LOAD_POLLING,
    timeout: LOAD_TIMEOUT
});

log('Building document ...'); // this line okay to print out

await page.waitForFunction(() => !!(Ext.isReady), {
    polling: LOAD_POLLING,
    timeout: LOAD_TIMEOUT
});