Recommand · November 24, 2021 0

nextjs getting mongodb dns error on page load

Currently creating a nextjs app with mongodb and I’m currently getting the following error and it’s driving me nuts trying to solve it

Failed to compile
Module not found: Can't resolve 'dns'

Import trace for requested module:

any help would be great to avoid issues like this in future.


I’ve tried yarn add dns

but that wouldn’t install