Error importing @planetscale/database

I am trying to setup my drizzle orm, but I am having an issue with the "@planetscale/database" module. Heres the error message:
Error: require() of ES Module 
C:\<PATH>\node_modules\@planetscale\database\dist\index.js from 
C:\<PATH>\db\connect.ts not supported.
Instead change the require of index.js in 
C:\<PATH>\db\connect.ts to a dynamic import() which is available in all CommonJS modules.

This happens when I run the following in my vercel serverless function
in both production and dev mode:
import 'dotenv/config'
import { connect } from "@planetscale/database";
import { drizzle } from "drizzle-orm/planetscale-serverless";

const conn = connect({
    host: process.env.DB_HOST!,
    username: process.env.DB_USERNAME!,
    password: process.env.DB_PASSWORD!,
});
export const db = drizzle(conn);

Following the setups outlined here: https://orm.drizzle.team/docs/installation-and-db-connection/mysql/planetscale

I tried to switch the import to a dynamic one but had issues related to importing in other modules as I had to then change my tsconfig settings.

Here is a stack overflow post by another person describing the same issue in nearly the same way: https://stackoverflow.com/questions/76424056/planetscale-database-produces-an-error-with-drizzle-in-hapi-with-ts-node-in

Please help I have spent a few hours looking for solutions and have no idea how to fix it. Also if anyone has any reading recommendations on the intricacies on nodes module system please let me know!
Stack Overflow
I am using Drizzle ORM and Planetscale.
Connecting to Planetscale I get an error:
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/@planetscale/database/dist/index.js from src/database/
Was this page helpful?