Giter VIP home page Giter VIP logo

Comments (10)

Szpadel avatar Szpadel commented on May 23, 2024 4

Just releases 1.11.0 that should resolve that issue, let me know if you still have any issues

from chrome-headless-render-pdf.

fethigurcan avatar fethigurcan commented on May 23, 2024 1

@Szpadel
Hello, I think that I found the solution.

It seems that CDP can't connect to debug port of chrome without any starter URL. So if you add any URL at spawn time, it will be ok.

you can fix with the code below. I have chosen about:blank as URL.

const commandLineOptions = [
'--headless',
--remote-debugging-port=${this.port},
'--disable-gpu',
...this.options.chromeOptions,
'about:blank'
];

@AlexAltea if you want quick fix. just copy the uncompiled index.js from node_molues\chrome-headless-render-pdf\index.js to node_molues\chrome-headless-render-pdf\dist folder. And add ,'about:blank' to commandLineOptions in the file like above.

Note: my fix is just tested under ubuntu.

from chrome-headless-render-pdf.

Szpadel avatar Szpadel commented on May 23, 2024 1

@fethigurcan you could also pass it in chromeOptions :)
That way you don't need to alter source code

from chrome-headless-render-pdf.

AlexAltea avatar AlexAltea commented on May 23, 2024

Updating to Chrome v110.0.5481.78 (Official Build) (64-bit) still does not fix the issue.

from chrome-headless-render-pdf.

AlexAltea avatar AlexAltea commented on May 23, 2024

Temporary workaround: Use Microsoft Edge to render documents

$ chrome-headless-render-pdf --url http://google.com --pdf test.pdf --chrome-binary 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
Using C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
Waiting for chrome to became available
Chrome port open!
Connected to HeadlessEdg/109.0.1518.70, protocol 1.3
Opening http://google.com
Wait for load took 170ms
Wait for js execution took 1ms
Wait for animations took 102ms
Saved test.pdf

from chrome-headless-render-pdf.

fethigurcan avatar fethigurcan commented on May 23, 2024

Same problem has started yesterday. I also tested on ubuntu beside the windows. same sympthoms.

Edge workaround does not work for me :(

@AlexAltea did you find a solution?

from chrome-headless-render-pdf.

Szpadel avatar Szpadel commented on May 23, 2024

I'll try to reproduce this on Monday

from chrome-headless-render-pdf.

AlexAltea avatar AlexAltea commented on May 23, 2024

@AlexAltea did you find a solution?

No I haven't. Currently my Edge version (which still works) is 109.0.1518.70 (Official build) (64-bit).

However, I'm getting update reminders so I will try to keep my computer/browser running until this issue is fixed.
Otherwise my invoicing system will break. 😄

I'll try to reproduce this on Monday

@Szpadel Thank you very much. Your library is really helpful.

from chrome-headless-render-pdf.

fethigurcan avatar fethigurcan commented on May 23, 2024

you are right. it is surely more simple workaround. thanks

the way that I dig the problem came to that solution though :))

from chrome-headless-render-pdf.

timon-michel-scopevisio avatar timon-michel-scopevisio commented on May 23, 2024

@Szpadel I'm on mentioned version 1.11.0 and still having this issue. Only on a small subset of hosts, even though they should be configured the same way, which is very interesting. They all use the same chromium version, same OS, same patch level of the OS, i cannot explain why this only happens on some hosts.
The hotfix adding --chrome-option=about:blank seems to work though, so it seems as though this fix is maybe not released yet?

from chrome-headless-render-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.