Hello
For some reason, I am unable to get a live view or download PDF’s anymore. This only happened when I tried to switch to the React version. It gave me a white screen with nothing loading, I then ran this command from another topic (Enabling React results in a blank screen )
UPDATE accounts SET set_react_as_default_ap = 0;
and I was back to the Flutter app. However since then, no PDF options work.
Below is a snip of console log I get from the time the application loads.
I have cleared cache as well when reloading.
Snip of .env file as well
hillel
April 19, 2024, 7:32am
2
Hi,
Is the APP_URL value correct in the .env file?
If it contains /index.php it usually means mod_rewrite needs to be enabled
If it contains /public it means the /public folder should be assigned as the web root instead
Hi @hillel
This is the value:
> APP_URL="https://admin.jtrict.co.za/ninja/public"
hillel
April 19, 2024, 7:59am
4
I suggest checking that mod_rewrite is enabled and mapping /public as the web root.
mod rewrite is enabled, and I made the public_html/admin/ninja/public to be the web root.
But now I get this error
Making the public_html/admin the root again fixes it.
hillel
April 19, 2024, 10:14am
6
Once you set /public as the web root you’ll need to update the APP_URL value to remove /public
I have done that, the application loads but the PDF isn’t working still
hillel
April 19, 2024, 12:30pm
8
What error are you seeing in the browser console?
When trying to view an invoice, it gives me this error
500: cURL error 28: Failed to connect to pdf.invoicing.co port 443 after 127444 ms: Couldn’t connect to server (see libcurl - Error Codes ) for https://pdf.invoicing.co/api/
hillel
April 19, 2024, 12:34pm
10
Are you able to reach this URL: https://pdf.invoicing.co
Even using the react app, it tells me “Something went wrong” when trying to view / download a PDF
hillel
April 19, 2024, 12:48pm
13
@david do you have any suggestions?
It really strange because it was working perfectly fine until I tried to switch to React and when that displayed a white screen, I used your SQL command to get it back to Flutter and then the PDF’s stopped working…
Hi @hillel and @david , I was doing some testing around…
While in debug mode, when I set the PDF_GENERATOR on the .env file
to snappdf, i get the below error
When it is set to phantom, i get the below error
When it is set to hosted_ninja, i get the below error
david
April 20, 2024, 12:57am
16
are you able to test your server connectivity to https://pdf.invoicing.co ?
hillel
April 20, 2024, 5:10pm
17
For SnapPDF it may help to run:
vendor/bin/snappdf download
The leading free source available online invoicing app for freelancers & businesses. Invoice, accept payments, track expenses, & time-tasks
Hi @david
This is my php script to test connectivity to https://pdf.invoicing.co
When the file is in this location, it works and is able to connect
However when the file is in the ninja folder, it isn’t able to connect
So it seems some config is wrong when in the ninja folder…
Does that shed any light on where the error could be ?
@hillel I am unable to run that command as this is a shared hosted site…
david
April 20, 2024, 7:47pm
19
I think you want to put that file in the public/ dir, not the root one.
Hi @david
Connectivity is a success in the public dir