Skip to content

Instantly share code, notes, and snippets.

@radjivF
Created July 23, 2021 10:54
Show Gist options
  • Save radjivF/f719f8a7e0284074ca61892b127c6714 to your computer and use it in GitHub Desktop.
Save radjivF/f719f8a7e0284074ca61892b127c6714 to your computer and use it in GitHub Desktop.
Fixes npm packages that depend on `fs` module on NextJS
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` `net `empty` module
if (!isServer) {
config.node = {
fs: 'empty',
net: 'empty',
tls: 'empty'
}
}
return config
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment