
> /etc/apt/sources.list.d/google.list' && \ apt-get update && \ apt-get install google-chrome-stable -y --no-install-recommends && \ rm -rf /var/lib/apt/lists/*Here is my docker-compose.yml just in caseversion: '3'services: m4carchiver-frontend: image: node:18 working_dir: /app environment: - NODE_ENV=development ports: - "3000:3000" volumes: - ./frontend:/app command: > sh -c "npm install && npm run dev" networks: - m4carchiver_network m4carchiver-backend: build: context: ./backend #image: oven/bun:latest working_dir: /app volumes: - ./backend:/app ports: - "80:80" - "443:443" - "4000:4000" command: > sh -c "bun run index.ts" networks: - m4carchiver_network networks: m4carchiver_network: driver: bridgeThen I open up a new browser browser = (browser !== undefined) ? browser : await puppeteer.launch({ executablePath: '/usr/bin/google-chrome', headless: 'new', args: [ '--disable-gpu', '--disable-dev-shm-usage', '--disable-setuid-sandbox', '--no-sandbox' ], }); //some other code... // Create a new page const page = await browser.newPage(); //await page.setDefaultTimeout(0); //await page.setRequestInterception(true); //page.on('response', onResponse); // Navigate to the specified URL console.log("Opening new page..."); await page.goto('https://www.google.com/'); // Wait for a moment to ensure the page is loaded await Promise.race([ new Promise(resolve => setTimeout(resolve, 60000)), // Timeout of 60000ms page.waitForNavigation({ waitUntil: 'networkidle0' }) // Wait until there is no more network activity ]); // Close the page page.close();" title="Puppeteer keeps timing out, why? [Docker, Puppeteer, NodeJS]">full image - Repost: Puppeteer keeps timing out, why? [Docker, Puppeteer, NodeJS] (from Reddit.com, Puppeteer keeps timing out, why? [Docker, Puppeteer, NodeJS])
Mining:
Exchanges:
Donations:
Right now I'm trying to archive a page with Docker and Puppeteer, here is my Dockerfile and here is my TypeScript code. My code works perfectly fine with Bun on my host machine so I dont know why its not working. I keep getting a custom Timeout error after 30 seconds, even with it disabled it just waits forever for google.com First I use Bun (also tried with node:slim) and I download ChromiumFROM oven/bun:latest as base# We don't need the standalone ChromiumENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true# Install Google Chrome Stable and fonts# Note: this installs the necessary libs to make the browser work with Puppeteer.RUN apt-get update && apt-get install gnupg wget -y && \ wget --quiet --output-document=- https://ift.tt/L9Cm5oB | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \ sh -c 'echo "deb [arch=amd64] https://ift.tt/fZFHuMQ stable main" >> /etc/apt/sources.list.d/google.list' && \ apt-get update && \ apt-get install google-chrome-stable -y --no-install-recommends && \ rm -rf /var/lib/apt/lists/*Here is my docker-compose.yml just in caseversion: '3'services: m4carchiver-frontend: image: node:18 working_dir: /app environment: - NODE_ENV=development ports: - "3000:3000" volumes: - ./frontend:/app command: > sh -c "npm install && npm run dev" networks: - m4carchiver_network m4carchiver-backend: build: context: ./backend #image: oven/bun:latest working_dir: /app volumes: - ./backend:/app ports: - "80:80" - "443:443" - "4000:4000" command: > sh -c "bun run index.ts" networks: - m4carchiver_network networks: m4carchiver_network: driver: bridgeThen I open up a new browser browser = (browser !== undefined) ? browser : await puppeteer.launch({ executablePath: '/usr/bin/google-chrome', headless: 'new', args: [ '--disable-gpu', '--disable-dev-shm-usage', '--disable-setuid-sandbox', '--no-sandbox' ], }); //some other code... // Create a new page const page = await browser.newPage(); //await page.setDefaultTimeout(0); //await page.setRequestInterception(true); //page.on('response', onResponse); // Navigate to the specified URL console.log("Opening new page..."); await page.goto('https://ift.tt/B8LgkoX); // Wait for a moment to ensure the page is loaded await Promise.race([ new Promise(resolve => setTimeout(resolve, 60000)), // Timeout of 60000ms page.waitForNavigation({ waitUntil: 'networkidle0' }) // Wait until there is no more network activity ]); // Close the page page.close();
Social Media Icons