diff --git a/src/lib/mongo/mongodb.ts b/src/lib/mongo/mongodb.ts index c9154449..90ae5097 100644 --- a/src/lib/mongo/mongodb.ts +++ b/src/lib/mongo/mongodb.ts @@ -1,7 +1,9 @@ // This approach is taken from https://github.com/vercel/next.js/tree/canary/examples/with-mongodb import { MongoClient } from 'mongodb'; -import { MONGODB_URI } from '$env/static/private'; +import dotenv from 'dotenv'; +dotenv.config(); +const MONGODB_URI = process.env.MONGODB_URI; if (!MONGODB_URI) { throw new Error('Invalid/Missing environment variable: "MONGODB_URI"'); }