Skip to content

Error: Invalid arguments passed to jsPDF.text #3241

@jaykhatri

Description

@jaykhatri

Using jsPdf for angular, this works fine on the local system with

npm run dev:ssr

But as soon as I deploy this on Ubuntu 20.04 server with Nginx, this throws below error:

ERROR Error: Uncaught (in promise): Error: Invalid arguments passed to jsPDF.text
Error: Invalid arguments passed to jsPDF.text
    at Object.h.__private__.text.h.text (7-es2018.cadec05923acd2afd6b5.js:1)
    at 7-es2018.cadec05923acd2afd6b5.js:1
    at u.invoke (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at Object.onInvoke (main-es2018.f6950bea29589438d00b.js:1)
    at u.invoke (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at s.run (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at polyfills-es2018.8feea6f74c7bd3468812.js:1
    at u.invokeTask (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at Object.onInvokeTask (main-es2018.f6950bea29589438d00b.js:1)
    at u.invokeTask (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at w (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at polyfills-es2018.8feea6f74c7bd3468812.js:1
    at u.invokeTask (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at Object.onInvokeTask (main-es2018.f6950bea29589438d00b.js:1)
    at u.invokeTask (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at s.runTask (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at m (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at c.invokeTask [as invoke] (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at h (polyfills-es2018.8feea6f74c7bd3468812.js:1)
    at Image.d (polyfills-es2018.8feea6f74c7bd3468812.js:1)

Upon debugging I found that the 4th argument is creating the problem
TextOptionsLight.align

this works fine
pdf.text('Subtotal', 290, col2y);

But this ins't:
pdf.text(wallet.toString(), 270, col1y, {align:'right'});

I doubled check the version of jsPdf is latest one 2.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions