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:
This happens when I run the following in my vercel serverless function
in both production and dev mode:
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!
This happens when I run the following in my vercel serverless function
in both production and dev mode:
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!
Drizzle ORM | %s
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/
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/