Closed qnxdev closed 4 years ago
What version of next
are you using because I suspect you are using an older version? nextjs-mongodb-app
only supports next.js v9.3 or later.
This usually happens why you try to use mongodb
on the client-side (probably by accident). Did you make any changes to the code?
Also req.db.collection('posts')
is incomplete. You probably want req.db.collection('posts').find().toArray()
(find every document and transform them into array)
Some pages will be SSR but most of them is SSG. You can first rename .env.example to .env to try it out.
For the error, I would need to know what changes you made to the code if any because I don’t see that on my dev env
null_ref