I am using Next.js with Vercel PostgreSQL. I have connected my project to Vercel PostgreSQL. It works fine in production but I encounter errors in development.
Previously, I was facing issues while testing locally. However, after deploying it, the project is functioning properly in production without any problems. Unfortunately, I am still facing errors during local development, which are depicted in the attached images. Please note that I have imported the environment variables into the local setup and linked the project properly.I've tried installing node_modules again as well.
I'd suggest checking the following:
PostgreSQL String Credentials: Make sure that the string credentials for connecting to your PostgreSQL database are set up correctly, both in your local setup and on your production deployment.
Node.js Version Compatibility: Check if your Node.js version aligns with your project requirements. It seems that the issue may stem from discrepancies in Node.js versions.
It seems that the problem lies with the Node.js version. I would suggest utilizing a version manager like "n" (n – Interactively Manage Your Node.js Versions) to manage your Node.js versions efficiently.
npm i n
You can shift to Node.js version 19, which is compatible with most dependencies and frameworks like next.js. Please retest your project locally to confirm if the issue persists.
If you encounter any further issues or require additional assistance, please don't hesitate to ask.