score:1

create next.config.js and put below code. it works fine for me.

next.config.js

module.exports = {
    webpack: (config, { buildid, dev, isserver, defaultloaders, webpack }) => {
      // note: we provide webpack above so you should not `require` it
      // perform customizations to webpack config
      // important: return the modified config

      // example using webpack option
      //config.plugins.push(new webpack.ignoreplugin(/\/__tests__\//))
      config.node = {fs:"empty"}
      return config
    },
    webpackdevmiddleware: config => {
      // perform customizations to webpack dev middleware config
      // important: return the modified config
      return config
    },
  }

Related Query

More Query from same tag