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

[Bug]: goto hangs on headless: false #9047

Closed
lublak opened this issue Oct 5, 2022 · 24 comments
Closed

[Bug]: goto hangs on headless: false #9047

lublak opened this issue Oct 5, 2022 · 24 comments

Comments

@lublak
Copy link

lublak commented Oct 5, 2022

Bug description

Steps to reproduce the problem:
(it works without headless: false)

  1. launch puppeteer with headless
const browser = await puppeteer.launch({
      headless: false,
});
  1. use goto
const [page] = await browser.pages();
await page.goto(`http://localhost:5678/workflows/demo`);

Puppeteer version

18.1.0

Node.js version

v16.17.1

npm version

8.15.0

What operating system are you seeing the problem on?

Windows

Relevant log output

D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:167
    return new Errors_js_1.TimeoutError(errorMessage);
           ^

    at LifecycleWatcher._LifecycleWatcher_createTimeoutPromise (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:167:12)
    at async Frame.waitForNavigation (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:272:23)
    at async CDPPage.waitForNavigation (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1146:16)
    at async Function.start (D:\test\dist\src\n8n.js:87:9)
    at async handleDocumentations (D:\test\dist\src\index.js:17:17)
@lublak lublak added the bug label Oct 5, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Oct 5, 2022

Does it fail navigating to any website or only http://localhost:5678/workflows/demo? Could you publish http://localhost:5678/workflows/demo so that we could reproduce if it only happens on that page?

@lublak
Copy link
Author

lublak commented Oct 6, 2022

@OrKoN http://localhost:5678/workflows/demo is n8n https://github.com/n8n-io/n8n (npm install n8n -g)
But i also tested it with: await page.goto('https://www.google.de');

image

@OrKoN
Copy link
Collaborator

OrKoN commented Oct 6, 2022

Unfortunately, I am not able to reproduce on Mac with either of the URLs. Could you try reproducing this with puppeteer@18.0.5? Also, could you run the script with the env var DEBUG=puppeteer:* and share the log that is produced.

@lublak
Copy link
Author

lublak commented Oct 6, 2022

@OrKoN I have also tried it with puppeteer@18.0.5 and only then changed to 18.1.0 to exclude the possibility that the error is already fixed.

Here is the debug log:

puppeteer:fetcher [
  puppeteer:fetcher   {
  puppeteer:fetcher     revision: '1045629',
  puppeteer:fetcher     executablePath: 'D:\\test\\node_modules\\puppeteer\\.local-chromium\\win64-1045629\\chrome-win\\chrome.exe',
  puppeteer:fetcher     folderPath: 'D:\\test\\node_modules\\puppeteer\\.local-chromium\\win64-1045629',
  puppeteer:fetcher     local: true,
  puppeteer:fetcher     url: 'https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1045629/chrome-win.zip',
  puppeteer:fetcher     product: 'chrome'
  puppeteer:fetcher   }
  puppeteer:fetcher ] +0ms
  puppeteer:launcher [
  puppeteer:launcher   'Calling D:\\test\\node_modules\\puppeteer\\.local-chromium\\win64-1045629\\chrome-win\\chrome.exe --allow-pre-commit-input --disable-background-networking --enable-features=NetworkServiceInProcess2 --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache,AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --enable-blink-features=IdleDetection --export-tagged-pdf about:blank --remote-debugging-port=0 --user-data-dir=C:\\Users\\dvbluh\\AppData\\Local\\Temp\\puppeteer_dev_chrome_profile-8spGHC'
  puppeteer:launcher ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setDiscoverTargets","params":{"discover":true,"filter":[{"type":"tab","exclude":true},{}]},"id":1}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":2}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"8E05D82AF4CB30B8156F911DFBD61C6B","type":"page","title":"","url":"about:blank","attached":false,"canAccessOpener":false,"browserContextId":"0A81953A8D33B1BAEFEBD90261DAAB13"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"d6615741-556b-447e-a468-564ac783d4aa","type":"browser","title":"","url":"","attached":true,"canAccessOpener":false}}}'       
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":1,"result":{}}' ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"8E05D82AF4CB30B8156F911DFBD61C6B","type":"page","title":"","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"0A81953A8D33B1BAEFEBD90261DAAB13"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","targetInfo":{"targetId":"8E05D82AF4CB30B8156F911DFBD61C6B","type":"page","title":"","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"0A81953A8D33B1BAEFEBD90261DAAB13"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":3}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Runtime.runIfWaitingForDebugger","id":4}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":2,"result":{}}' ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.enable","id":5}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.getFrameTree","id":6}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Performance.enable","id":7}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Log.enable","id":8}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"8E05D82AF4CB30B8156F911DFBD61C6B","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"0A81953A8D33B1BAEFEBD90261DAAB13"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":3,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":4,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":5,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":6,"result":{"frameTree":{"frame":{"id":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","url":"about:blank","domainAndRegistry":"","securityOrigin":"://","mimeType":"text/html","adFrameStatus":{"adFrameType":"none"},"secureContextType":"InsecureScheme","crossOriginIsolatedContextType":"NotIsolated","gatedAPIFeatures":[]}}},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'        
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":7,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":8,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.frameResized","params":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.setLifecycleEventsEnabled","params":{"enabled":true},"id":9}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Runtime.enable","id":10}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Network.enable","id":11}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"commit","timestamp":2478.509851},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"DOMContentLoaded","timestamp":2478.510819},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"load","timestamp":2478.514136},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"networkAlmostIdle","timestamp":2478.514919},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"networkIdle","timestamp":2478.514919},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":9,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"://","name":"","uniqueId":"-6123752801213980795.4845388217280308827","auxData":{"isDefault":true,"type":"default","frameId":"8E05D82AF4CB30B8156F911DFBD61C6B"}}},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Runtime.evaluate","params":{"expression":"(() => {\\n              const module = {};\\n              \\"use strict\\";\\nvar __defProp 
= Object.defineProperty;\\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\\nvar __getOwnPropNames = Object.getOwnPropertyNames;\\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\\nvar __export = (target, all) => 
{\\n  for (var name in all)\\n    __defProp(target, name, { get: all[name], enumerable: true });\\n};\\nvar __copyProps = (to, from, except, desc) => {\\n  if (from && typeof from === \\"object\\" || typeof from === \\"function\\") {\\n    for (let key of __getOwnPropNames(from))\\n      if (!__hasOwnProp.call(to, key) && key !== except)\\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\\n  }\\n  return to;\\n};\\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod);\\n\\n// src/injected/injected.ts\\nvar injected_exports = {};\\n__export(injected_exports, {\\n  default: () => injected_default\\n});\\nmodule.exports = __toCommonJS(injected_exports);\\n\\n// src/common/Errors.ts\\nvar CustomError = class extends Error {\\n  constructor(message) {\\n    super(message);\\n  
  this.name = this.constructor.name;\\n    Error.captureStackTrace(this, this.constructor);\\n  }\\n};\\nvar TimeoutError = class extends CustomError {\\n};\\nvar ProtocolError = class extends CustomError {\\n  code;\\n  originalMessage = \\"\\";\\n};\\nvar errors = Object.freeze({\\n  TimeoutError,\\n  ProtocolError\\n});\\n\\n// src/util/DeferredPromise.ts\\nfunction createDeferredPromise(opts) {\\n  let isResolved = false;\\n  let isRejected = false;\\n  let resolver;\\n  let rejector;\\n  const taskPromise = new Promise((resolve, reject) => {\\n    resolver = resolve;\\n    rejector = reject;\\n  });\\n  const timeoutId = opts && opts.timeout > 0 ? setTimeout(() 
=> {\\n    isRejected = true;\\n    rejector(new TimeoutError(opts.message));\\n  }, opts.timeout) : void 0;\\n  return Object.assign(taskPromise, {\\n    resolved: () => {\\n      return isResolved;\\n    },\\n    finished: 
() => {\\n      return isResolved || isRejected;\\n    },\\n    resolve: (value) => {\\n      if (timeoutId) {\\n        clearTimeout(timeoutId);\\n      }\\n      isResolved = true;\\n      resolver(value);\\n    },\\n    reject: (err) => {\\n      clearTimeout(timeoutId);\\n      isRejected = true;\\n      rejector(err);\\n    }\\n  });\\n}\\n\\n// src/util/assert.ts\\nvar assert = (value, message) => {\\n  if (!value) {\\n    throw new Error(message);\\n  }\\n};\\n\\n// src/injected/Poller.ts\\nvar MutationPoller = class {\\n  #fn;\\n  #root;\\n  #observer;\\n  #promise;\\n  constructor(fn, root) {\\n    this.#fn = fn;\\n    this.#root = root;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#observer = new MutationObserver(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    });\\n    this.#observer.observe(this.#root, {\\n      childList: true,\\n      subtree: true,\\n      attributes: true\\n    });\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#observer) {\\n      this.#observer.disconnect();\\n      this.#observer = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar RAFPoller = class {\\n  #fn;\\n  #promise;\\n  constructor(fn) {\\n    this.#fn = fn;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    const poll = async () => {\\n      if (promise.finished()) {\\n        return;\\n      }\\n  
    const result2 = await this.#fn();\\n      if (!result2) {\\n        window.requestAnimationFrame(poll);\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    };\\n    window.requestAnimationFrame(poll);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar IntervalPoller = class {\\n  #fn;\\n  #ms;\\n  #interval;\\n  #promise;\\n  constructor(fn, ms) {\\n    this.#fn = fn;\\n    this.#ms = ms;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#interval = setInterval(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    }, this.#ms);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#interval) {\\n      clearInterval(this.#interval);\\n      this.#interval = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\n\\n// src/injected/TextContent.ts\\nvar TRIVIAL_VALUE_INPUT_TYPES = /* @__PURE__ */ new Set([\\"checkbox\\", \\"image\\", \\"radio\\"]);\\nvar isNonTrivialValueNode = (node) => {\\n  if (node instanceof HTMLSelectElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLTextAreaElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLInputElement && !TRIVIAL_VALUE_INPUT_TYPES.has(node.type)) {\\n    return true;\\n  }\\n  return false;\\n};\\nvar 
UNSUITABLE_NODE_NAMES = /* @__PURE__ */ new Set([\\"SCRIPT\\", \\"STYLE\\"]);\\nvar isSuitableNodeForTextMatching = (node) => {\\n  return !UNSUITABLE_NODE_NAMES.has(node.nodeName) && !document.head?.contains(node);\\n};\\nvar textContentCache = /* @__PURE__ */ new WeakMap();\\nvar eraseFromCache = (node) => {\\n  while (node) {\\n    textContentCache.delete(node);\\n    if (node instanceof ShadowRoot) {\\n      node = node.host;\\n    } else {\\n      node = node.parentNode;\\n    }\\n  }\\n};\\nvar observedNodes = /* @__PURE__ */ new WeakSet();\\nvar textChangeObserver = new MutationObserver((mutations) => {\\n  for (const mutation of mutations) {\\n    eraseFromCache(mutation.target);\\n  }\\n});\\nvar createTextContent = (root) => {\\n  let value = textContentCache.get(root);\\n  if (value) {\\n    return value;\\n  }\\n  value = { full: \\"\\", immediate: [] };\\n  if (!isSuitableNodeForTextMatching(root)) {\\n    return value;\\n  }\\n  let currentImmediate = \\"\\";\\n  if (isNonTrivialValueNode(root)) {\\n    value.full = root.value;\\n    value.immediate.push(root.value);\\n    root.addEventListener(\\n      \\"input\\",\\n      (event) => {\\n        eraseFromCache(event.target);\\n      },\\n      { once: true, capture: true }\\n    );\\n  } else {\\n    for (let child = root.firstChild; child; child = child.nextSibling) {\\n      if (child.nodeType === Node.TEXT_NODE) {\\n        value.full += child.nodeValue ?? \\"\\";\\n        currentImmediate += child.nodeValue ?? \\"\\";\\n        continue;\\n      }\\n      if (currentImmediate) {\\n        value.immediate.push(currentImmediate);\\n      }\\n      currentImmediate = \\"\\";\\n      if (child.nodeType === Node.ELEMENT_NODE) {\\n        value.full += createTextContent(child).full;\\n      }\\n    }\\n   
 if (currentImmediate) {\\n      value.immediate.push(currentImmediate);\\n    }\\n    if (root instanceof Element && root.shadowRoot) {\\n      value.full += createTextContent(root.shadowRoot).full;\\n    }\\n    if (!observedNodes.has(root)) {\\n      textChangeObserver.observe(root, {\\n        childList: true,\\n        characterData: true\\n      });\\n      observedNodes.add(root);\\n    }\\n  }\\n  textContentCache.set(root, value);\\n  return value;\\n};\\n\\n// src/injected/TextQuerySelector.ts\\nvar TextQuerySelector_exports = {};\\n__export(TextQuerySelector_exports, {\\n  textQuerySelector: () => textQuerySelector,\\n  textQuerySelectorAll: () => textQuerySelectorAll\\n});\\nvar textQuerySelector = (root, selector) => {\\n  for (const node of root.childNodes) {\\n    if (node instanceof Element && isSuitableNodeForTextMatching(node)) {\\n      let matchedNode;\\n      if (node.shadowRoot) {\\n        matchedNode = textQuerySelector(node.shadowRoot, selector);\\n      } else {\\n        matchedNode = textQuerySelector(node, selector);\\n      }\\n      if (matchedNode) {\\n        return matchedNode;\\n      }\\n    }\\n  }\\n  if (root instanceof Element) {\\n    const textContent = createTextContent(root);\\n    if (textContent.full.includes(selector)) {\\n      return root;\\n    }\\n  }\\n  return null;\\n};\\nvar textQuerySelectorAll = (root, selector) => {\\n  let results = [];\\n  for (const node of root.childNodes) {\\n    if (node instanceof Element) {\\n      let matchedNodes;\\n      if (node.shadowRoot) {\\n        matchedNodes = textQuerySelectorAll(node.shadowRoot, selector);\\n      } else {\\n        matchedNodes = textQuerySelectorAll(node, selector);\\n      }\\n      results = results.concat(matchedNodes);\\n    }\\n  }\\n  if (results.length > 0) {\\n    return results;\\n  }\\n  if (root instanceof Element) {\\n    const textContent = createTextContent(root);\\n    if (textContent.full.includes(selector)) {\\n      return [root];\\n    }\\n  }\\n  return [];\\n};\\n\\n// src/injected/XPathQuerySelector.ts\\nvar XPathQuerySelector_exports = {};\\n__export(XPathQuerySelector_exports, {\\n  xpathQuerySelector: () => xpathQuerySelector,\\n  xpathQuerySelectorAll: () => xpathQuerySelectorAll\\n});\\nvar xpathQuerySelector = (root, selector) => {\\n  const doc = root.ownerDocum'... 3877 more characters
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":10,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":11,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.addScriptToEvaluateOnNewDocument","params":{"source":"//# sourceURL=pptr://__puppeteer_evaluation_script__","worldName":"__puppeteer_utility_world__"},"id":13}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":12,"result":{"result":{"type":"object","className":"Object","description":"Object","objectId":"-8552369594736292519.1.1"}},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":13,"result":{"identifier":"1"},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.createIsolatedWorld","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","worldName":"__puppeteer_utility_world__","grantUniveralAccess":true},"id":14}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Runtime.executionContextCreated","params":{"context":{"id":2,"origin":"","name":"__puppeteer_utility_world__","uniqueId":"-5935191774561943384.4827825280308243434","auxData":{"isDefault":false,"type":"isolated","frameId":"8E05D82AF4CB30B8156F911DFBD61C6B"}}},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Runtime.evaluate","params":{"expression":"(() => {\\n              const module = {};\\n              \\"use strict\\";\\nvar __defProp 
= Object.defineProperty;\\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\\nvar __getOwnPropNames = Object.getOwnPropertyNames;\\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\\nvar __export = (target, all) => 
{\\n  for (var name in all)\\n    __defProp(target, name, { get: all[name], enumerable: true });\\n};\\nvar __copyProps = (to, from, except, desc) => {\\n  if (from && typeof from === \\"object\\" || typeof from === \\"function\\") {\\n    for (let key of __getOwnPropNames(from))\\n      if (!__hasOwnProp.call(to, key) && key !== except)\\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\\n  }\\n  return to;\\n};\\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod);\\n\\n// src/injected/injected.ts\\nvar injected_exports = {};\\n__export(injected_exports, {\\n  default: () => injected_default\\n});\\nmodule.exports = __toCommonJS(injected_exports);\\n\\n// src/common/Errors.ts\\nvar CustomError = class extends Error {\\n  constructor(message) {\\n    super(message);\\n  
  this.name = this.constructor.name;\\n    Error.captureStackTrace(this, this.constructor);\\n  }\\n};\\nvar TimeoutError = class extends CustomError {\\n};\\nvar ProtocolError = class extends CustomError {\\n  code;\\n  originalMessage = \\"\\";\\n};\\nvar errors = Object.freeze({\\n  TimeoutError,\\n  ProtocolError\\n});\\n\\n// src/util/DeferredPromise.ts\\nfunction createDeferredPromise(opts) {\\n  let isResolved = false;\\n  let isRejected = false;\\n  let resolver;\\n  let rejector;\\n  const taskPromise = new Promise((resolve, reject) => {\\n    resolver = resolve;\\n    rejector = reject;\\n  });\\n  const timeoutId = opts && opts.timeout > 0 ? setTimeout(() 
=> {\\n    isRejected = true;\\n    rejector(new TimeoutError(opts.message));\\n  }, opts.timeout) : void 0;\\n  return Object.assign(taskPromise, {\\n    resolved: () => {\\n      return isResolved;\\n    },\\n    finished: 
() => {\\n      return isResolved || isRejected;\\n    },\\n    resolve: (value) => {\\n      if (timeoutId) {\\n        clearTimeout(timeoutId);\\n      }\\n      isResolved = true;\\n      resolver(value);\\n    },\\n    reject: (err) => {\\n      clearTimeout(timeoutId);\\n      isRejected = true;\\n      rejector(err);\\n    }\\n  });\\n}\\n\\n// src/util/assert.ts\\nvar assert = (value, message) => {\\n  if (!value) {\\n    throw new Error(message);\\n  }\\n};\\n\\n// src/injected/Poller.ts\\nvar MutationPoller = class {\\n  #fn;\\n  #root;\\n  #observer;\\n  #promise;\\n  constructor(fn, root) {\\n    this.#fn = fn;\\n    this.#root = root;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#observer = new MutationObserver(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    });\\n    this.#observer.observe(this.#root, {\\n      childList: true,\\n      subtree: true,\\n      attributes: true\\n    });\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#observer) {\\n      this.#observer.disconnect();\\n      this.#observer = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar RAFPoller = class {\\n  #fn;\\n  #promise;\\n  constructor(fn) {\\n    this.#fn = fn;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    const poll = async () => {\\n      if (promise.finished()) {\\n        return;\\n      }\\n  
    const result2 = await this.#fn();\\n      if (!result2) {\\n        window.requestAnimationFrame(poll);\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    };\\n    window.requestAnimationFrame(poll);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar IntervalPoller = class {\\n  #fn;\\n  #ms;\\n  #interval;\\n  #promise;\\n  constructor(fn, ms) {\\n    this.#fn = fn;\\n    this.#ms = ms;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#interval = setInterval(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    }, this.#ms);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#interval) {\\n      clearInterval(this.#interval);\\n      this.#interval = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\n\\n// src/injected/TextContent.ts\\nvar TRIVIAL_VALUE_INPUT_TYPES = /* @__PURE__ */ new Set([\\"checkbox\\", \\"image\\", \\"radio\\"]);\\nvar isNonTrivialValueNode = (node) => {\\n  if (node instanceof HTMLSelectElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLTextAreaElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLInputElement && !TRIVIAL_VALUE_INPUT_TYPES.has(node.type)) {\\n    return true;\\n  }\\n  return false;\\n};\\nvar 
UNSUITABLE_NODE_NAMES = /* @__PURE__ */ new Set([\\"SCRIPT\\", \\"STYLE\\"]);\\nvar isSuitableNodeForTextMatching = (node) => {\\n  return !UNSUITABLE_NODE_NAMES.has(node.nodeName) && !document.head?.contains(node);\\n};\\nvar textContentCache = /* @__PURE__ */ new WeakMap();\\nvar eraseFromCache = (node) => {\\n  while (node) {\\n    textContentCache.delete(node);\\n    if (node instanceof ShadowRoot) {\\n      node = node.host;\\n    } else {\\n      node = node.parentNode;\\n    }\\n  }\\n};\\nvar observedNodes = /* @__PURE__ */ new WeakSet();\\nvar textChangeObserver = new MutationObserver((mutations) => {\\n  for (const mutation of mutations) {\\n    eraseFromCache(mutation.target);\\n  }\\n});\\nvar createTextContent = (root) => {\\n  let value = textContentCache.get(root);\\n  if (value) {\\n    return value;\\n  }\\n  value = { full: \\"\\", immediate: [] };\\n  if (!isSuitableNodeForTextMatching(root)) {\\n    return value;\\n  }\\n  let currentImmediate = \\"\\";\\n  if (isNonTrivialValueNode(root)) {\\n    value.full = root.value;\\n    value.immediate.push(root.value);\\n    root.addEventListener(\\n      \\"input\\",\\n      (event) => {\\n        eraseFromCache(event.target);\\n      },\\n      { once: true, capture: true }\\n    );\\n  } else {\\n    for (let child = root.firstChild; child; child = child.nextSibling) {\\n      if (child.nodeType === Node.TEXT_NODE) {\\n        value.full += child.nodeValue ?? \\"\\";\\n        currentImmediate += child.nodeValue ?? \\"\\";\\n        continue;\\n      }\\n      if (currentImmediate) {\\n        value.immediate.push(currentImmediate);\\n      }\\n      currentImmediate = \\"\\";\\n      if (child.nodeType === Node.ELEMENT_NODE) {\\n        value.full += createTextContent(child).full;\\n      }\\n    }\\n   
 if (currentImmediate) {\\n      value.immediate.push(currentImmediate);\\n    }\\n    if (root instanceof Element && root.shadowRoot) {\\n      value.full += createTextContent(root.shadowRoot).full;\\n    }\\n    if (!observedNodes.has(root)) {\\n      textChangeObserver.observe(root, {\\n        childList: true,\\n        characterData: true\\n      });\\n      observedNodes.add(root);\\n    }\\n  }\\n  textContentCache.set(root, value);\\n  return value;\\n};\\n\\n// src/injected/TextQuerySelector.ts\\nvar TextQuerySelector_exports = {};\\n__export(TextQuerySelector_exports, {\\n  textQuerySelector: () => textQuerySelector,\\n  textQuerySelectorAll: () => textQuerySelectorAll\\n});\\nvar textQuerySelector = (root, selector) => {\\n  for (const node of root.childNodes) {\\n    if (node instanceof Element && isSuitableNodeForTextMatching(node)) {\\n      let matchedNode;\\n      if (node.shadowRoot) {\\n        matchedNode = textQuerySelector(node.shadowRoot, selector);\\n      } else {\\n        matchedNode = textQuerySelector(node, selector);\\n      }\\n      if (matchedNode) {\\n        return matchedNode;\\n      }\\n    }\\n  }\\n  if (root instanceof Element) {\\n    const textContent = createTextContent(root);\\n    if (textContent.full.includes(selector)) {\\n      return root;\\n    }\\n  }\\n  return null;\\n};\\nvar textQuerySelectorAll = (root, selector) => {\\n  let results = [];\\n  for (const node of root.childNodes) {\\n    if (node instanceof Element) {\\n      let matchedNodes;\\n      if (node.shadowRoot) {\\n        matchedNodes = textQuerySelectorAll(node.shadowRoot, selector);\\n      } else {\\n        matchedNodes = textQuerySelectorAll(node, selector);\\n      }\\n      results = results.concat(matchedNodes);\\n    }\\n  }\\n  if (results.length > 0) {\\n    return results;\\n  }\\n  if (root instanceof Element) {\\n    const textContent = createTextContent(root);\\n    if (textContent.full.includes(selector)) {\\n      return [root];\\n    }\\n  }\\n  return [];\\n};\\n\\n// src/injected/XPathQuerySelector.ts\\nvar XPathQuerySelector_exports = {};\\n__export(XPathQuerySelector_exports, {\\n  xpathQuerySelector: () => xpathQuerySelector,\\n  xpathQuerySelectorAll: () => xpathQuerySelectorAll\\n});\\nvar xpathQuerySelector = (root, selector) => {\\n  const doc = root.ownerDocum'... 3877 more characters
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":14,"result":{"executionContextId":2},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Emulation.setDeviceMetricsOverride","params":{"mobile":false,"width":800,"height":600,"deviceScaleFactor":1,"screenOrientation":{"angle":0,"type":"portraitPrimary"}},"id":16}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Emulation.setTouchEmulationEnabled","params":{"enabled":false},"id":17}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":15,"result":{"result":{"type":"object","className":"Object","description":"Object","objectId":"-8552369594736292519.2.1"}},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.frameResized","params":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":16,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":17,"result":{},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
http://localhost:5682/workflows/demo
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028","method":"Page.navigate","params":{"url":"http://localhost:5682/workflows/demo","frameId":"8E05D82AF4CB30B8156F911DFBD61C6B"},"id":18}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Network.requestWillBeSent","params":{"requestId":"80B9465ED670D1C503951937521B33FB","loaderId":"80B9465ED670D1C503951937521B33FB","documentURL":"http://localhost:5682/workflows/demo","request":{"url":"http://localhost:5682/workflows/demo","method":"GET","headers":{"Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","sec-ch-ua":"\\"Chromium\\";v=\\"107\\", \\"Not=A?Brand\\";v=\\"24\\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\\"Windows\\""},"mixedContentType":"none","initialPriority":"VeryHigh","referrerPolicy":"strict-origin-when-cross-origin","isSameSite":true},"timestamp":2478.777023,"wallTime":1665040383.547203,"initiator":{"type":"other"},"redirectHasExtraInfo":false,"type":"Document","frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","hasUserGesture":false},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"networkAlmostIdle","timestamp":2478.514919},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"8E05D82AF4CB30B8156F911DFBD61C6B","loaderId":"FA82CC397BB47897DEA789191F338323","name":"networkIdle","timestamp":2478.514919},"sessionId":"FC4A9A312DBF2CAEADD1271D4649F028"}'
  puppeteer:protocol:RECV ◀ ] +0ms
D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:167
    return new Errors_js_1.TimeoutError(errorMessage);
           ^

TimeoutError: Navigation timeout of 30000 ms exceeded
    at LifecycleWatcher._LifecycleWatcher_createTimeoutPromise (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\LifecycleWatcher.js:167:12)
    at async Frame.goto (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:205:21)
    at async CDPPage.goto (D:\test\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1083:16)
    at async Function.start (D:\test\dist\src\n8n.js:88:9)
    at async handleDocumentations (D:\test\dist\src\index.js:17:17)

@OrKoN
Copy link
Collaborator

OrKoN commented Oct 6, 2022

@lublak so it happens in 18.0.5 for you too? It looks like the browser does not respond to the Page.navigate and does not send the expected page load event. So it's either a problem with the binary or smth on your system is blocking the load, perhaps? We will need to try on Windows.

@lublak
Copy link
Author

lublak commented Oct 6, 2022

@OrKoN I have made completely new clean installation of the modules with 18.0.5 and once 18.1.0
The error remains. Strangely enough it works in headless mode. I'll see if I can get another PC to test it. What could be blocking it?

@OrKoN
Copy link
Collaborator

OrKoN commented Oct 6, 2022

I am not sure: there are no more details in the log. But you can see that the Page.navigate command with "id":18 is sent and there should be a response with the same id. It looks like the navigation hangs on the browser side.

@OrKoN
Copy link
Collaborator

OrKoN commented Oct 6, 2022

It could be very well be some issue in the Windows binary. It would be good if you could try it on a different machine. I will find a Windows machine in the meantime.

@pecampelo
Copy link
Contributor

pecampelo commented Oct 10, 2022

I have been running multiple instances of Puppeteer in that same version, on Windows x64. I do not believe it is due to the OS. Could it be related to the chromium version bundled?

If you could also give us a little hint on what kind of page are you trying to load, maybe? Or more prolific logs? It seems the navigation is not being detected through page events, we need to take into consideration it could be from the browser but also the page being served.

@lublak
Copy link
Author

lublak commented Oct 14, 2022

@pecampelo @OrKoN Sry I was the last few days very under stress because of emergency work.
This page does not really play a role here. No page works as soon as I set "headless: false" here.

I have now also started the bundled chrome manually.
There I can navigate in the pages. As soon as I start it via pupetter and open a new tab with e.g. google.com it does not work.
I have always used it directly with google.com now and will also use google.com for future tests as this can be used by anyone.

Chromium Version:
107.0.5296.0 dev build 64 bit
image

I have already sent the log. What exactly would you like?

I will try again today on my private computer the problem is on this computer.
I can also look that I leave the computer on so that I can connect to VPN. I am actually on vacation the next two weeks and no longer go to the company. I hope this works.

@miro-balaz
Copy link

I have example of phishing site where it also hangs (even with headless), but i cannot share it. It has no protection from bots, just redirects to dead site and then puppeteer hangs in navigation indefinitely. One speciality is that it uses responses that are just <script> or without surrounding tags. On Puppeteer 10.2 with chromium, it works properly.

It stops after being navigated to chrome-error://chromewebdata/ from page.on('framenavigated',...

Problem is probably in waiting logic, because if I use Page.navigate and then wait for fixed amount , then chrome does not hang. I keep on debugging. If there is some good way how to debug this i would appreciate an advice.

@OrKoN
Copy link
Collaborator

OrKoN commented Nov 4, 2022

@miro-balaz it'd be great if you could create a minimal page (that does the same kind of navigations/causes same errors) that demonstrates the problem

@pecampelo
Copy link
Contributor

hey, @lublak, I read your request but I believe it is hard to provide debugging to an issue with a site that we don't have access to. I totally agree with @OrKoN, if you could provide some sort of page that simulates your error, we could attempt on trying to solve the problem with you.

@lublak
Copy link
Author

lublak commented Nov 4, 2022

@pecampelo Yes, I am still trying to find out if I can create a simple example. Problem is that it works on my private computer at home without problems. Only in the company something blocks there.

@miro-balaz
Copy link

@OrKoN That would be hard, it has to be server. I have found that problem is in waiting for resposne that does not arive, and that wait is without timeout. see #onRequest in lifecycleWatcher

@OrKoN
Copy link
Collaborator

OrKoN commented Nov 4, 2022

are you using puppeteer 19.2.2?

@pecampelo
Copy link
Contributor

@pecampelo Yes, I am still trying to find out if I can create a simple example. Problem is that it works on my private computer at home without problems. Only in the company something blocks there.

@lublak, I am thinking of suggesting you to create a dockerized application at your company that does the job, do you think that is more viable to do in your company network? That way we could replicate it, and even look at network ins and outs.

What do you think of it, @OrKoN?

@OrKoN
Copy link
Collaborator

OrKoN commented Nov 4, 2022

@pecampelo I won't be trying to analyze an entire dockerized app (too time consuming)

@pecampelo
Copy link
Contributor

Now that I think of it, it does seem too time consuming and overtly bulky to actually provide some benefit...
@lublak try understanding if there are any limitations to your network as in proxy-wise, and then I would suggest on trying to update puppeteer to the latest version, as previously mentioned here by @OrKoN. I have been using Puppeteer in production in headless false for months now, both locally, in dockerized applications and in production without no issue whatsoever.

@lublak
Copy link
Author

lublak commented Nov 4, 2022

@pecampelo @OrKoN Hey who knows what's going crazy here. It's probably way too complicated to solve. But really great of you that you have given the effort up to here.
I would say that we can close it here for now. I mean I test the things then simply on my private computer. Nobody complains about that. ❤️

@miro-balaz
Copy link

@OrKoN After upgrading to 19.2.2 my problem is solved, thanks, i was on 19.2.0 before.

@OrKoN
Copy link
Collaborator

OrKoN commented Nov 7, 2022

@miro-balaz then it was a variation of #9175

@lublak I wonder if the fix also solves the issue you reported?

@lublak
Copy link
Author

lublak commented Nov 7, 2022

@OrKoN unfortunately not. As soon as I go into the headless: false it hangs.
Also with version 19.2.2

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 23, 2024

Closing as there is no good way to test this. Please file a new issue if there is a reproducible example.

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants