question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Save error: writeFileSync is not a function

See original GitHub issue

In the latest version of jsPDF (2.1.0), when trying to save a document, I’m getting the following error:

TypeError: r.writeFileSync is not a function
    at Object.N.save (jspdf.js:5669)

I’m importing jsPDF as import { jsPDF } from 'jspdf';, and am using jspdf client-side. Any idea on how to solve this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
HackbrettXXXcommented, Aug 27, 2020

Could you test if your app works with the files from the pull request (you need to run npm run build first)?

1reaction
HackbrettXXXcommented, Aug 28, 2020

Great! I’ll merge it and I will probably prepare a bugfix release next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does fs.writeFileSync() throws "is not a function" error?
In my app I use it like this : const fs = require('fs'); const stateFile = "./usersStateFile"; const saveLastEventSequenceId = (sequenceId) => ...
Read more >
TypeError: fs.writeFile is not a function · Issue #1280 - GitHub
Hello,. I'm trying to write to a file using the 'fs' module. I have an html page with javascript that I run from...
Read more >
TypeError: fs.readFileSync is not a Function in JS | bobbyhadz
The "fs.readFileSync" is not a function error occurs when we misspell the readFileSync method or try to use the method in the browser....
Read more >
Using the writeFileSync method in Node.js - LogRocket Blog
Learn to use writeFileSync in Node.js, a method that allows us to create files, write to files, and update files synchronously.
Read more >
Node.js | fs.writeFileSync() Method - GeeksforGeeks
writeFileSync() is a synchronous method. The fs.writeFileSync() creates a new file if the specified file does not exist.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found