Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

447
Views
How to write to JSON files in vercel

I'm trying to write to a few JSON files in my Next.js/Vercel app, but I keep getting the following error when my project deploys to Vercel

Failed to compile.
./node_modules/chownr/chownr.js
Module not found: Can't resolve 'fs' in '/vercel/path0/node_modules/chownr'
Import trace for requested module:
./node_modules/tar-fs/index.js
./node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js
./node_modules/puppeteer/lib/cjs/puppeteer/node/Puppeteer.js
./node_modules/puppeteer/lib/cjs/puppeteer/initialize-node.js
./node_modules/puppeteer/lib/cjs/puppeteer/node.js
./node_modules/puppeteer/cjs-entry.js
./pages/index.js
./node_modules/extract-zip/index.js
Module not found: Can't resolve 'fs' in '/vercel/path0/node_modules/extract-zip'

code which uses fs

fs.writeFile('./data/cases.json', 
    JSON.stringify(cases_to_write), (err) => {
        if (err) throw err;
        console.log('The file has been saved!', 'cases');
    });

Anyone have any ideas on how I can use fs in my app?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!