How to Solve the Module not found: Cannot resolve 'fs' error in Next.js
Webpack 4 versionTo resolve the error with Webpack 4, you need to tell webpack to set the module to ‘empty’ on the client-side (!isServer). This is also a solution when you are working with older Next