net::ERR_NAME_NOT_RESOLVED

Hi, I was following the drizzle planetscale starter made by josh (https://github.com/joschan21/drizzle-planetscale-starter) and I came across some erros I didn't know how to fix. I have the following server component:
import { db } from "app/lib/db/index";
import { subjects } from "app/lib/db/schema"

export const runtime = 'edge'

export default async function Home() {
const subjectList = await db.select().from(subjects)

return (
<>
<p>my subjects:</p>
{subjectList.map((subject) => (
<div key={subject.id}>{subject.name}</div>
))}
</>
)
}
import { db } from "app/lib/db/index";
import { subjects } from "app/lib/db/schema"

export const runtime = 'edge'

export default async function Home() {
const subjectList = await db.select().from(subjects)

return (
<>
<p>my subjects:</p>
{subjectList.map((subject) => (
<div key={subject.id}>{subject.name}</div>
))}
</>
)
}
and when I try view this I get thousands of console errors (more errors just keep coming, its like an infinite amount of console errors) of just the same thing:
// index.js:115 POST https://undefined/psdb.v1alpha1.Database/Execute net::ERR_NAME_NOT_RESOLVED
// index.js:115 POST https://undefined/psdb.v1alpha1.Database/Execute net::ERR_NAME_NOT_RESOLVED
I'm pretty sure this has to do with my database URL, but I could be wrong My db/index looks like this:
import { drizzle } from "drizzle-orm/planetscale-serverless";
import { connect } from "@planetscale/database";

// create the connection
const connection = connect({
host: process.env.DATABASE_URL,
});

export const db = drizzle(connection);
import { drizzle } from "drizzle-orm/planetscale-serverless";
import { connect } from "@planetscale/database";

// create the connection
const connection = connect({
host: process.env.DATABASE_URL,
});

export const db = drizzle(connection);
and my drizzle.config.ts looks like this:
import type { Config } from "drizzle-kit";

export default {
schema: "./app/lib/db/schema.ts",
out: "./drizzle",
dbCredentials: {
connectionString: process.env.DATABASE_URL,
}
} satisfies Config;
import type { Config } from "drizzle-kit";

export default {
schema: "./app/lib/db/schema.ts",
out: "./drizzle",
dbCredentials: {
connectionString: process.env.DATABASE_URL,
}
} satisfies Config;
my .env looks like this:
DATABASE_URL='mysql:[email protected]/mydbname?ssl={"rejectUnauthorized":true}'
DATABASE_URL='mysql:[email protected]/mydbname?ssl={"rejectUnauthorized":true}'
with ?ssl={"rejectUnauthorized":true} coming from the docs. any idea on how to fix this? thanks
GitHub
GitHub - joschan21/drizzle-planetscale-starter: NextJS 13 Starter K...
NextJS 13 Starter Kit for Planetscale & DrizzleORM - GitHub - joschan21/drizzle-planetscale-starter: NextJS 13 Starter Kit for Planetscale & DrizzleORM
1 Reply
wlvz
wlvzOP2y ago
? when i go on safari the error updates to: [Error] Fetch API cannot load https://undefined/psdb.v1alpha1.Database/Execute due to access control checks. [Error] Failed to load resource: A server with the specified hostname could not be found. (Execute, line 0)
Want results from more Discord servers?
Add your server