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]: setcontent times out. #12466

Closed
1 of 2 tasks
Lock23Supply opened this issue May 20, 2024 · 2 comments
Closed
1 of 2 tasks

[Bug]: setcontent times out. #12466

Lock23Supply opened this issue May 20, 2024 · 2 comments

Comments

@Lock23Supply
Copy link

Minimal, reproducible example

const puppeteer = require('puppeteer');
const fs = require('fs');

async function generatePDF(content, outputPath) {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.setContent(content);
const.log("it reaches here...");
    const pdf = await page.pdf({ format: 'A4' }); // this crashes in the latest
console.log("but not here...");
    await browser.close();
    fs.writeFileSync(outputPath, pdf);
}

(async () => {
    // Generate two PDFs
    await generatePDF('<h1>First PDF</h1>', 'first.pdf');
    await generatePDF('<h1>Second PDF</h1>', 'second.pdf');

    console.log('PDFs generated');
})();

Error string

async timeout

Bug behavior

  • Flaky
  • PDF

Background

No response

Expectation

it should create a pdf as it does in "puppeteer": "^22.3.0",

Reality

the app times out after 30000ms

Puppeteer configuration file (if used)

No response

Puppeteer version

22.9.0

Node version

20.11.1

Package manager

npm

Package manager version

10.5.0

Operating system

Windows

Copy link

This issue was not reproducible. Please check that your example runs locally and the following:

  • Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
  • Ensure the error string is just the error message.
    • Bad:

      Error: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:23:47
    • Good: Error: something went wrong.

  • Ensure your configuration file (if applicable) is valid.
  • If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
  • If the issue is not expected to error, make sure to write 'no error'.

Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.


Analyzer run

@OrKoN
Copy link
Collaborator

OrKoN commented May 21, 2024

Probably duplicate of #12470

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 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

2 participants