Having Issue with PDF Generation

I am now running 5.5.41 which does generate PDFs properly. In this version when I open in the same browser and toggle the console to ON the Live Preview doesn’t load, same behaviour as before, this must be seperate to the change in 5.5.41 → 5.5.42 that is causing PDFs to not generate.

Though I don’t think the Live PDF Preview not running when the console is enabled is much of a problem as I normally use the Invoice Ninja App and not via Web Browser. And if running in the Web Browser it would be not common to have the console open I would think.

I am running self hosted on a local computer and am using the default PDF Generator, I just checked my env file and it’s ‘snappdf’.

@david @hillel

Did you have an update on this by any chance? I just updated to 5.5.71 to see if anything had changed. In the macOS App when I press ‘View PDF’ I get this error:

SocketException: Failed host lookup: ‘in5.test’ (OS Error: nodename nor servname provided, or not known, errno = 8)

Thank you!

Is the PDF working in the web app or the client portal?

I don’t run a client portal but in the web app it is not working.
The error that returns is: XMLHttpRequest error.

If I open Developer Tools in the browser and select View PDF this is what the console shows:

main.foss.dart.js?v=5.5.74:94006
GET http://in5.test:8000/client/invoice/YwIwA3wqKuKJLlwyg4f9IabN8b7sahyi/download?t=1677138984758&t=1677138984758 net::ERR_NAME_NOT_RESOLVED

When I look at main.foss.dart.js?v=5.5.74 under sources it shows Line 94006 having the error with this code:

iJ(a,b){return a.send(b)},

Is the URL correct? You may need to change the APP_URL value in the .env file.

The APP_URL is as follows:

APP_URL=http://192.168.0.142:8000

The App URL worked fine in V5.5.41, after that it’s broken. Just running on a local network in a Docker Container. Am I doing something wrong with the App URL?

@david do you have any suggestions?

the app looks like it is configured for a different URL

main.foss.dart.js?v=5.5.74:94006
GET http://in5.test:8000/client/invoice/YwIwA3wqKuKJLlwyg4f9IabN8b7sahyi/download?t=1677138984758&t=1677138984758 net::ERR_NAME_NOT_RESOLVED

http://in5.test:8000

you may need to add in5.test to your hosts file in /etc/hosts and point it to your IP address.

Thanks @david

I’ve figured out the issue. The only place ‘in5.test:8000’ appears anywhere is Invoice Ninja → Settings → Client Portal → Domain URL. So I changed the value there to ‘http://192.168.0.142:8000’ which is identical to the ‘APP_URL’ in the env file.

I wasn’t aware that I was using the Client Portal. I’ve now updated to the latest version and the PDF Generation is working when I select ‘View PDF’. Weird that it worked with the old values on V5.5.4.1, something must have changed.

@brad

Ok this makes sense. We implemented the client portal override in between those two releases that allows users to select the domain their serve their client portal from.