DEV Community

Discussion on: webpack 5 & next.js 10 - how to add resolve fallback to config

Collapse
 
harishkurup profile image
harish kurup

Hi Did the same thing but still getting the following error
ERROR in ./node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can't resolve 'fs'

My webpack config
module.exports = {
resolve: {
fallback: {
fs: false,
"path": require.resolve("path-browserify"),
"os": require.resolve("os-browserify/browser")
}
}
};