simonbengtsson / jsPDF-AutoTable

jsPDF plugin for generating PDF tables with javascript
https://simonbengtsson.github.io/jsPDF-AutoTable/
MIT License
2.33k stars 624 forks source link

jsPDF PubSub Error #237

Closed birendra-ideas2it closed 7 years ago

birendra-ideas2it commented 7 years ago

When i run with production then i got error.. jsPDF PubSub Error Cannot set property 'pdf' of undefined TypeError: Cannot set property 'pdf' of undefined

simonbengtsson commented 7 years ago

Do you get the same error if you try without loading the autotable plugin?

On Tue, Feb 28, 2017, 12:14 Birendra Kumar notifications@github.com wrote:

When i run with production then i got error.. jsPDF PubSub Error Cannot set property 'pdf' of undefined TypeError: Cannot set property 'pdf' of undefined

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/simonbengtsson/jsPDF-AutoTable/issues/237, or mute the thread https://github.com/notifications/unsubscribe-auth/ADa6g5zX_scerr4XCL3oT0OOhODs2vyrks5rhAGRgaJpZM4MORJq .

birendra-ideas2it commented 7 years ago

No, i didn't get the error without loading the autotable plugin.

Node Version - v0.12.0

jsPDF PubSub Error this.canvas is undefined TypeError: this.canvas is undefined Stack trace: @http://ec2-52-49-139-206.eu-west-1.compute.amazonaws.com:8080/min/production.v1487948417657.min.js:12:13071

simonbengtsson commented 7 years ago

What version of jspdf and jspdf autotable are you using?

(And btw, as far as I know jspdf does not support node. It has to be used in the browser)

simonbengtsson commented 7 years ago

Closing for now. Feel free to reopen if you did not find a solution.

Kreestian commented 7 years ago

I have the same issue, only on production. My versions:

    "jspdf": "1.3.3",
    "jspdf-autotable": "2.3.1",

and have the following of errors:

jsPDF PubSub Error Cannot read property 'annotations' of undefined TypeError: Cannot read property 'annotations' of undefined
jsPDF PubSub Error Cannot set property 'pdf' of undefined TypeError: Cannot set property 'pdf' of undefined
Error: PNG support requires png.js and zlib.js

I use jspdf only on client side. I tried it without the jspdf-autotable, but still not working. Any idea about the solution?

bahmutskyi commented 7 years ago

Exactly same issue. Any updates?

bahmutskyi commented 7 years ago

Had the same issue. Occured only with minified version of the project. Updating grunt-contrib-uglify and grunt-usemin solved the problem for me.

allanpoppe commented 7 years ago

I'm having the same issue, however I use gulp instead of grunt. Updating gulp-uglify and gulp-minify-html did not solved my problem.

Any ideas?

simonbengtsson commented 7 years ago

Do you get the same issue without loading the jspdf plugin?

allanpoppe commented 7 years ago

The issue is jsPdf related, not autotable related. Also, it only happens when using the minified version of jsPdf. When using the debug version, it runs with no problem. And only happens in production.

On Sat, Jul 8, 2017, 06:00 Simon Bengtsson notifications@github.com wrote:

Do you get the same issue without loading the jspdf plugin?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/simonbengtsson/jsPDF-AutoTable/issues/237#issuecomment-313844171, or mute the thread https://github.com/notifications/unsubscribe-auth/AS_4iUNlCLYgd11x04MJLzSDVRjhe3Z7ks5sL0U4gaJpZM4MORJq .

-- [image: Allan Poppe | GUni] allan.poppe@guni.com.brAllan Poppe Chief Technology Officer (11) 96224 0642 allan.poppe@guni.com.br www.guni.com.br http://www.guni.com.br/app/

simonbengtsson commented 7 years ago

Right now im not in a position where I can track down the issue, but if there is no similar issue in the jspdf repo it would probably be good to continue discussions there.

bahmutskyi commented 7 years ago

@allanpoppe , u sure u have the latest versions of uglify and minify?

allanpoppe commented 7 years ago

@Bagma, you were correct. When I first read your comment, I did a npm install gulp-uglify --save-dev and I thought npm would install the latest version. My mistake. With your second comment now, I researched the last version and realized that my version was very obsolete. Then I updated uglify to the latest version and now the minified version works in production. Thank you! Thank you too @simonbengtsson

gbluv commented 7 years ago

Had similar issue and could not update uglifier. Wind up requiring debug version which solved the issue

window.jsPDF = require('jspdf/dist/jspdf.debug');