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

webContents.printToPDF rejects in v8.0.0-beta.5 #21708

Closed
3 tasks done
jacobq opened this issue Jan 8, 2020 · 5 comments · Fixed by #21783
Closed
3 tasks done

webContents.printToPDF rejects in v8.0.0-beta.5 #21708

jacobq opened this issue Jan 8, 2020 · 5 comments · Fixed by #21783

Comments

@jacobq
Copy link
Contributor

jacobq commented Jan 8, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Note: related but different issues:

Issue Details

  • Electron Version:
    • v8.0.0-beta.5 (also happens in 9.0.0-nightly.20191220 & 9.0.0-nightly.20200108)
  • Operating System:
    • Debian (bullseye/sid) x64, 5.3.0 kernel
  • Last Known Working Electron version:
    • 7.1.8, 8.0.0-beta.4, See bisect

Expected Behavior

Calling someBrowserWindow.webContents.printToPDF should not throw exception / generate promise rejection.

Actual Behavior

Calling someBrowserWindow.webContents.printToPDF rejects with [Error: Failed to generate PDF].

To Reproduce

Fiddle: https://gist.github.com/jacobq/cc5e5e1736b88cb32604f55369afd1c7
Repo: https://github.com/jacobq/electron-quick-start/tree/bug/print-to-pdf

mainWindow.webContents.once('did-finish-load', async function() {
  try {
    const pdfData = await mainWindow.webContents.printToPDF({})
    console.log('Got PDF data -->', pdfData) // never gets here
  } catch(e) {
    // output --> Call to printToPDF threw exception [Error: Failed to generate PDF]
    console.error('Call to printToPDF threw exception', e)
  }
});
@jacobq
Copy link
Contributor Author

jacobq commented Jan 10, 2020

FWIW When I bisected, I found 05cde0d to be the first commit with the problem.

Log
git bisect start
# bad: [acd2eabdfd5a5b145b99f336d57ca820b13b48e2] Bump v8.0.0-beta.5
git bisect bad acd2eabdfd5a5b145b99f336d57ca820b13b48e2
# good: [d998bf9feddcfad2889869eb18fdbec7a2832a11] Bump v8.0.0-beta.4
git bisect good d998bf9feddcfad2889869eb18fdbec7a2832a11
# good: [2ab56802cb9ea7549c9020731bdc69618e201f0c] fix: restore POST forms that open a new window with target=_blank (#21474)
git bisect good 2ab56802cb9ea7549c9020731bdc69618e201f0c
# bad: [8dabb3fe335539d46b3a5d635127f073d5d1212b] docs: update installation docs to reflect latest @electron/get changes (#21540)
git bisect bad 8dabb3fe335539d46b3a5d635127f073d5d1212b
# bad: [6c1eb46f685025d34caf07be83d86729e4d67447] Bump v8.0.0-beta.5
git bisect bad 6c1eb46f685025d34caf07be83d86729e4d67447
# good: [696c94c08a5999ac337789883dcfb2028110af7c] fix: sourcemaps not loading with network service (#21493)
git bisect good 696c94c08a5999ac337789883dcfb2028110af7c
# bad: [05cde0d945eb07d388704c34c70878a0f1509d2a] chore: bump chromium to 80.0.3987.6 (8-x-y) (#21061)
git bisect bad 05cde0d945eb07d388704c34c70878a0f1509d2a
# first bad commit: [05cde0d945eb07d388704c34c70878a0f1509d2a] chore: bump chromium to 80.0.3987.6 (8-x-y) (#21061)

@jacobq
Copy link
Contributor Author

jacobq commented Jan 10, 2020

@deepak1556 It looks like #21061 skips the printToPDF test and this is still present in master. Was this an oversight that was supposed to be taken care of before the PR landed? I see that 0c80767 was a "FIXME" commit

@sofianguy sofianguy added this to Unsorted Issues in 8.2.x Jan 11, 2020
@codebytere codebytere moved this from Unsorted Issues to Blocks Stable in 8.2.x Jan 13, 2020
@codebytere codebytere self-assigned this Jan 13, 2020
@codebytere
Copy link
Member

codebytere commented Jan 14, 2020

@jacobq i've tracked it down to Chromium CL 1917685 as the culprit; should hopefully have some more progress & answers soon!

@jacobq
Copy link
Contributor Author

jacobq commented Jan 15, 2020

@jacobq i've tracked it down...

Thanks for digging into this. When I discovered that it broke after a Chromium update I threw up my hands and didn't know what to do next (have not yet had to peel back that layer).

@codebytere
Copy link
Member

codebytere commented Jan 15, 2020

@jacobq PR is up and it should be fixed in the next beta. Chromium is a complicated terror zone so it's not just you 😅

@sofianguy sofianguy moved this from Blocks Stable to Fixed for Next Release in 8.2.x Jan 16, 2020
@sofianguy sofianguy moved this from Fixed for Next Release to Fixed in 8.0.0-beta.7 in 8.2.x Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
8.2.x
Fixed in 8.0.0-beta.7
Development

Successfully merging a pull request may close this issue.

3 participants