PlatformException(error, Promise was rejected with a value of ‘undefined’

Hi guys.
I’m getting this error too:

Settings env:

#options - snappdf / phantom / hosted_ninja


Any ideas why this error occurs and how it can be fixed?


Where in the app are you seeing this error?

Also, have you tried changing to hosted_ninja?

Hi Hillel and thanks for your reply.

When I’m attempting to view or print the PDF. If you attempt to download it then it just is corrupted

Yes i did. No success. I also tempted to add the lines with “PHANTOMJS_PDF_GENERATION=false” as well. As suggested here:

Did not work.

After that i did try this:

cd [invoiceninja base path]/vendor/beganovich/snappdf
./snappdf download --force

Which did not work either.

I did revert to phanthom for now which does work. But it would of course be nice to have the snappdf working.

@david do you have any suggestions?

The problem may be that you are executing this command as a user that is not the webuser.

Say your user is named angry and you run the snappdf download method. This will download Chrome and set angry as the owner/group

When the webserver user www-data attempts to run chrome, it will fail with an error message that may look like Signal Process (5) indicating that the user that is attempting to run the program, does not have sufficient permissions.

The easiest way to prevent any of this is to run all commands as the webuser. ie

sudo -u www-data ./vendor'/bin/snappdf download