DB connection not initiated in api/statistics/total.js for next.js.
See original GitHub issueDescription
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.
Screenshots
Additional information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eddiejaoude Please assign it to me I will fix it.
@jasham Thanks for informing.