Servesh
Servesh
DTDrizzle Team
Created by Servesh on 5/29/2024 in #help
Unable to run drizzle query for supabase
I've tried npm, pnpm and bun to check if was something related to how modules are resolved. Here is my drizzle.ts:
import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'

const connectionString = process.env.DATABASE_URL!

export const client = postgres(connectionString, { prepare: false })
export const db = drizzle(client)
import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'

const connectionString = process.env.DATABASE_URL!

export const client = postgres(connectionString, { prepare: false })
export const db = drizzle(client)
Getting this stack trace:
Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "cloudflare:" URIs.
Import trace for requested module:
cloudflare:sockets
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/index.js
./db/drizzle.ts
Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "cloudflare:" URIs.
Import trace for requested module:
cloudflare:sockets
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js
./node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/index.js
./db/drizzle.ts
Below is my package json dependencies.
"dependencies": {
"@hono/zod-validator": "^0.2.1",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-slot": "^1.0.2",
"@tanstack/react-query": "^5.40.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dotenv": "^16.4.5",
"drizzle-orm": "^0.30.10",
"hono": "^4.4.0",
"lucide-react": "^0.378.0",
"next": "14.2.3",
"next-themes": "^0.3.0",
"pg": "^8.11.5",
"postgres": "^3.4.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-use": "^17.5.0",
"sonner": "^1.4.41",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
}
"dependencies": {
"@hono/zod-validator": "^0.2.1",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-slot": "^1.0.2",
"@tanstack/react-query": "^5.40.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dotenv": "^16.4.5",
"drizzle-orm": "^0.30.10",
"hono": "^4.4.0",
"lucide-react": "^0.378.0",
"next": "14.2.3",
"next-themes": "^0.3.0",
"pg": "^8.11.5",
"postgres": "^3.4.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-use": "^17.5.0",
"sonner": "^1.4.41",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
}
I searched online and found it was happenning for pg 8.11 and tried to manually set it to 8.10 like below and running pnpm up but to no avail:
"pg": "8.10.0",
"pg": "8.10.0",
Any help is much appreciated.
15 replies
DTDrizzle Team
Created by Servesh on 5/24/2024 in #help
Unable to setup supabase with drizzle
Using this https://orm.drizzle.team/learn/tutorials/drizzle-with-supabase#setup-supabase-and-drizzle-orm to setup supabase but always getting errors on migration and studio scripts. I'm using pnpm and have setup my .env.local variables. Drizzle version:
drizzle-kit: v0.21.2
drizzle-orm: v0.30.10
drizzle-kit: v0.21.2
drizzle-orm: v0.30.10
15 replies