You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above happens when we dynamically append the <script> tag at the bottom of <body> (using custom code here).
Amazingly, no error prints out if we hard-code the <script> tag!
const jsPDF = require('jspdf')
var pdf = new jsPDF('p', 'pt', 'letter')
but you have to check what is the result in terms of javascript code when we issue a require in the Node environment - I mean what's the code that the browser runs? (browser javascript is not Node javascript).
Now can you change the CDN version of the library?
The text was updated successfully, but these errors were encountered:
OK, I think you messed with automatic bundlers like everybody these days...
Replace first lines with these:
Now we can make:
without errors.
File I'm referred to:
jspdf.debug.js
at thedist
folder of your project.Now let's include minified version from CDN:
browser prints at console:
The above happens when we dynamically append the
<script>
tag at the bottom of<body>
(using custom code here).Amazingly, no error prints out if we hard-code the
<script>
tag!From stackoverflow one proposes:
but you have to check what is the result in terms of javascript code when we issue a
require
in the Node environment - I mean what's the code that the browser runs? (browser javascript is not Node javascript).Now can you change the CDN version of the library?
The text was updated successfully, but these errors were encountered: