So I have a digitialocean app platform where I am trying to build my application which is a Next.js 14.2.3 app. I had it build and everything with a simple landing page but now I have added routes that are dynamic and I have properly placed the export const dynamic = 'force-dynamic' at the top of the file since I dont want them to be static pages. But on my db.ts file I had a throw error if I couldnt find the connection. It showed me this when it tried to build and then I changed the db.ts file to lazy load the db connection. Now it gives me other errors. I wanted to know if anyone has done a deploy on DIgitalOcean and how they handle the database connection at build time? I have the environment variable set for the app so it should have it but somehow it still shows me an error. Ill post images of the file and error.
#Proper way to handle a drizzle database on digitialocean app platform.
1 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
nvm found out what was happening. I think the main error was just that one of my variables wasnt set to run at build time... this is fixed.