Skip to content

Fix “Module not found: Can't resolve encoding” in Next.js

New Course Coming Soon:

Get Really Good at Git

I ran into this error in a Next.js application:

Module not found: Can’t resolve ‘encoding’ in …/node_modules/node-fetch/lib’

To fix this, I ran npm install encoding and the error was gone!

Here is how can I help you: