Webpack Express Cannot Resolve Module ‘fs’, Request Dependency is Expression

Just posting an answer, since not everyone reads comments on SO. @Aurora0001 nailed it. Webpack’s config needs to have this set:

"target": "node"

Leave a Comment