Closed IRediTOTO closed 4 years ago
Are you in the dev environment? I think this is caused by React HMR.
Are you in the dev environment? I think this is caused by React HMR.
yes, in local, I just checked on server, look like every thing work ok. "React HMR" ? You mean fetch api 2 times on client side ?
Sorry, React HMR is Hot Module Replacement. The server sorta "restarts" every time you make a change, so the mongodb connect function runs multiple times.
Describe the bug hi, i got this error from mongodb, i searched for it on google https://jira.mongodb.org/browse/NODE-1868 problem because call mongodb too many time.
So I think to create a middleware called end.js. Is this the best way to fix this error ? Thank you