unable to run drizzle studio

im uitlizing drizzle orm in next.js however when i run the drizzle studio using drizzle kit it seems to be stuck here is my drizzle.config.ts file: *import { defineConfig } from "drizzle-kit"; import { env } from "@/env"; export default defineConfig({ schema: "./src/db/schema.ts", dialect: "postgresql", out: "./drizzle", dbCredentials: { url: env.DATABASE_URL, }, verbose: true, strict: true, }); * here is my db:studio command: * "db:studio": "drizzle-kit studio --config=drizzle.config.ts"*
No description
11 Replies
Deleted_user_f8439ab4ed59
it seems to work fine pushing a migration but somehow drizzle kit studio seems to be unable to run
Arjun
Arjun6mo ago
whats the issue? If its similar to this then I have posted the fix https://discord.com/channels/1043890932593987624/1247244064567590914 and I also opened a GH issue to get this issue patched
Deleted_user_f8439ab4ed59
im unable to open drizzle studio at all
Arjun
Arjun6mo ago
Your drizzle config is incorrect
Arjun
Arjun6mo ago
Drizzle ORM - Configuration
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Arjun
Arjun6mo ago
import { defineConfig } from "drizzle-kit";
// Import removed

export default defineConfig({
schema: "./src/db/schema.ts",
dialect: "postgresql",
out: "./drizzle",
dbCredentials: {
url: process.env.DATABASE_URL,
// Changes here
},
verbose: true,
strict: true,
});
import { defineConfig } from "drizzle-kit";
// Import removed

export default defineConfig({
schema: "./src/db/schema.ts",
dialect: "postgresql",
out: "./drizzle",
dbCredentials: {
url: process.env.DATABASE_URL,
// Changes here
},
verbose: true,
strict: true,
});
Deleted_user_f8439ab4ed59
how is my config incorrect?
A Dapper Raccoon
I think dot's suggesting that you should obtain the connection string from the environment instead of a file... but if it's the same value either way, it's hard to imagine that would change anything. Maybe upgrade your ORM and Kit packages to latest and try again, just to make sure you're not running into some bug which has since been squashed? It is very suspect that your db:studio script specifies --config but the studio CLI mentions "No config path provided," but if the default path which it is falling back to is correct, that's still unlikely to be the culprit... Have you thrown like a console.log({DATABASE_URL: env.DATABASE_URL}) into your drizzle.config.ts to ensure that kit is indeed using using that configuration whilst attempting to launch studio, and that your connection string is correct in that instance?
Deleted_user_f8439ab4ed59
i think its weird because im able to make migrations
A Dapper Raccoon
It's definitely super strange. I don't know enough about Kit/Studio to have any useful insights, but I did experience a similar situation using the (now deprecated in Kit v0.22) d1 configuration for drizzle.config.ts to connect to a local mock database... Migrate worked fine, but Studio would stall as yours does. Turns out Studio just didn't support the configuration at all. But your config relies on the core postgresql functionality - it's really hard to imagine what might be going wrong. Seems like Studio generally really needs to improve upon it's error messages.
Deleted_user_f8439ab4ed59
thank you for trying to help me however it seems to work after 15 min's however im unsure why this happens tbh
Want results from more Discord servers?
Add your server