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

215
Views
NextJS 12 and webpack 5 unknown property 'fs'

I have upgraded from Next10 to Next12 (webpack5), also from React16 to React17. This is how some of our next.config.js looks like:

const config = {
  webpack: (config, { isServer, buildId }) => {
    // Fixes npm packages that depend on `fs` module
    config.node = {
      fs: 'empty',
    }

When running a dev server this error comes up and I'm not sure how to work around it:

ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration[0].node has an unknown property 'fs'. These properties are valid:
   object { __dirname?, __filename?, global? }
   -> Options object for node compatibility features.
 - configuration[1].node has an unknown property 'fs'. These properties are valid:
   object { __dirname?, __filename?, global? }
   -> Options object for node compatibility features.
    at validate (C:\Users\Alvaro Lamadrid\Documents\origin\origin-dollar\dapp\node_modules\next\dist\compiled\schema-utils3\index.js:1:150822)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Make sure that you preserve all the default settings in your next.config.js

config.node = { ...config.node, fs: "empty" }

about 4 years ago · Juan Pablo Isaza Report
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!