Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DB connection not initiated in api/statistics/total.js for next.js.

See original GitHub issue


When user opens localhost:3000 of next.js version in index.js file have /api/statistics/totals url which is calling api/statistics/total.js and in this file db connection is not made due to which getting MongooseError: Operation stats.findOne() buffering timed out after 10000ms error.



Additional information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

jashamcommented, Aug 16, 2022

@eddiejaoude Please assign it to me I will fix it.

prajapati55commented, Aug 31, 2022

@jasham Thanks for informing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initialize code at server startup and make it available in ctx
(js|ts) . When present, the next command would execute it before starting the actual server. Here is what it would look like:.
Read more >
Data Fetching: getStaticProps - Next.js
Fetch data and generate static pages with `getStaticProps`. Learn more about this API for data fetching in Next.js.
Read more >
How to Integrate MongoDB Into Your Next.js App
We can create API endpoints, get data by running server-side rendered functions for a particular page, or even generate static pages by getting ......
Read more >
NextJS MySQL example. Get MySQL data into a react app ...
In this tutorial you will learn how to connect to a MySQL database in react / NextJS and display the data on a...
Read more >
Next JS MongoDB Connection: 8 Easy Steps - Learn
A Next JS MongoDB connection will make it easy to move data from the ... the API endpoint and retrieve the posts from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found