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

How can I check the error when Uncaught SyntaxError appears in the log? #450

Open
RoyDeng opened this issue Oct 5, 2023 · 0 comments
Open

Comments

@RoyDeng
Copy link

RoyDeng commented Oct 5, 2023

This message will appear when I use the pdf and screenshot functions, and the final result will be a blank page. However, using content, the HTML can be obtained normally.

Logs

browser = await launch(
  args=[
    "--no-sandbox",
    "--disable-setuid-sandbox",
    "--single-process",
  ],
  dumpio=True,
)

page = await browser.newPage()

await page.goto(f"http://generate-pdf:3000/customer-invoice?name=")

pdf = await page.pdf({
  "format": "A4",
  "printBackground": True,
  "margin": {
    "top": "16px",
    "bottom": "16px",
    "left": "16px",
    "right": "16px",
  },
})

When this page is opened in an external browser, there is no error message in the DevTool console.

This page uses Next.js, and some resources are generated by this framework, which also makes it more difficult for me to find errors.

Is there any way to ignore it and force the PDF to be generated? Or how to intercept errors on the backend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant