Support Forums

Next js build error

I am trying to upload my next js app to Netlify but I keep getting an error when building.

ModuleNotFoundError: Module not found: Error: Can’t resolve ‘aws4’ in ‘/opt/build/repo/node_modules/mongodb/lib/core/auth’

I am using mongoose and my database is hosted in MongoDB Atlas

can some help please?

Hey there @RashedMahyoub :wave:

Welcome to the Netlify Forums, and thanks for reaching out. We will need a bit more information before with dive in here. Could you please share your site name, your repo, and your full build log?

Thank you I found a solution. I just installed the dependency and everything worked!.

1 Like

Thanks so much for sharing your solution here-- glad everything is working for you now!

1 Like