Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into a type error from the Drizzle-kit node modules when I run drizzle-kit push:pg[BUG]: #2257

Open
Cbakes24 opened this issue May 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Cbakes24
Copy link

Cbakes24 commented May 4, 2024

What version of drizzle-orm are you using?

0.29.5

What version of drizzle-kit are you using?

0.20.17

Describe the Bug

I am following Theo Browne's t3 stack build which uses nextjs, typescript, tailwind, drizzle, prisma. I am just starting to set up the db. I set up my index.ts in the server folder with the following code

`import { drizzle } from "drizzle-orm/vercel-postgres";
import { sql } from "@vercel/postgres";

import * as schema from "./schema";

// Use this object to send drizzle queries to your DB
export const db = drizzle(sql, { schema });
This issue comes when I try torun drizzle-kit push:pg` in the cli I am getting a TypeError from this file called bin.cjs in the node modules drizzle-kit folder.

From the cli:
Screenshot 2024-05-04 at 2 08 42 PM
Screenshot 2024-05-04 at 2 09 35 PM

`corybaker@corys-mbp-2 first_t3_app % pnpm run db:push

first_t3_app@0.1.0 db:push /Users/corybaker/Desktop/Practice_Projects/first_t3_app
drizzle-kit push:pg

/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:36676
Request2 = class extends GlobalRequest {
^

TypeError: Class extends value undefined is not a constructor or null
at node_modules/.pnpm/@HONO+node-server@1.9.0/node_modules/@hono/node-server/dist/index.mjs (/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:36676:30)
at __init (/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:9:56)
at src/serializer/studio.ts (/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:60347:5)
at __init (/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:9:56)
at Object. (/Users/corybaker/Desktop/Practice_Projects/first_t3_app/node_modules/.pnpm/drizzle-kit@0.20.17/node_modules/drizzle-kit/bin.cjs:65992:1)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
 ELIFECYCLE  Command failed with exit code 1.`

Expected behavior

the database should be created with the schema I added in.

Environment & setup

mac ios sonoma 14.4.1
node v16.18.1.

{
"name": "first_t3_app",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "next build",
"db:push": "drizzle-kit push:pg",
"db:studio": "drizzle-kit studio",
"dev": "next dev --turbo",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@heroicons/react": "^2.1.3",
"@t3-oss/env-nextjs": "^0.10.1",
"@vercel/postgres": "^0.8.0",
"drizzle-orm": "^0.29.4",
"next": "^14.2.1",
"postgres": "^3.4.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.23.3"
},
"devDependencies": {
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"drizzle-kit": "^0.20.14",
"eslint": "^8.57.0",
"eslint-config-next": "^14.1.3",
"eslint-plugin-drizzle": "^0.2.3",
"pg": "^8.11.3",
"postcss": "^8.4.34",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2"
},
"ct3aMetadata": {
"initVersion": "7.32.0"
},
"packageManager": "pnpm@8.7.3"
}

@Cbakes24 Cbakes24 added the bug Something isn't working label May 4, 2024
@meowhite
Copy link

meowhite commented May 5, 2024

same to me when running the drizzle-kit generate:pg command.
I am using Bun v1.1.3.

@TheGrinch00
Copy link

I solved it by using Node@18.19.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants