fraserxu / electron-pdf

📄 A command line tool to generate PDF from URL, HTML or Markdown files.
MIT License
1.24k stars 136 forks source link

"failed to get a service for display 3" on MacOS X, while running electron-pdf #126

Open ajmas opened 7 years ago

ajmas commented 7 years ago

I am running the following:

node_modules/.bin/electron-pdf ./document.html ./out.pdf

on doing so I get:

/Library/Caches/com.apple.xbs/Sources/AppleGVA/AppleGVA-10.0.41/Sources/Slices/Driver/AVD_loader.cpp: failed to get a service for display 3 
/Library/Caches/com.apple.xbs/Sources/AppleGVA/AppleGVA-10.0.41/Sources/Slices/Driver/AVD_loader.cpp: failed to get a service for display 4 
/Library/Caches/com.apple.xbs/Sources/AppleGVA/AppleGVA-10.0.41/Sources/Slices/Driver/AVD_loader.cpp: failed to get a service for display 5 
/Library/Caches/com.apple.xbs/Sources/AppleGVA/AppleGVA-10.0.41/Sources/Slices/Driver/AVD_loader.cpp: failed to get a service for display 6 

Any ideas?

Running on MacOS X 10.12, with Node 6.7.0 and electron-pdf 0.13.0

codecounselor commented 7 years ago

I haven't been doing a lot of testing with filesystem inputs, it looks like there is a bug with that right now. Can you try using a URL (i.e. http://www.google.com) and see if that resolves your issue?

I'm not able to reproduce the error you've reported, I'm on OSX 10.12.1

ajmas commented 7 years ago

Same issue, when trying with google. Command as typed:

node_modules/.bin/electron-pdf http://www.google.com out.pdf

It may be an Electron issue, so I'll need to I'll need to try to see if I can analyse a bit more?

BTW now at MacOS X 10.12.1. Thing is on a MacBook Air 13" (MacBookAir6,2)

eladnava commented 7 years ago

For what it's worth, I was able to run electron-pdf on a local .html file on El Capitan with no issues.

Maybe the fact that I installed electron-pdf globally made a difference?

kara-ryli commented 7 years ago

Worked like a charm for me on OSX 10.12.5 on a MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports), using a local version of electron-pdf using the latest LTS version of Node installed via NVM.

$ node -v
v6.11.0
$ node_modules/.bin/electron-pdf http://www.google.com out.pdf
Shutting down...

Some Google searching reveals this problem being reported with several Electron-based applications, e.g.

https://github.com/electron/electron/issues/7466

Due to the difficulty reproducing and the file locations including /Caches I'm guessing it was/is an OS X bug causing corrupted cache file that Electron and/or Chromium uses under the hood.