drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
23.81k stars 590 forks source link

[BUG]: Bun Drizzle Studio SSL error on Mac OS despite having installed a local certificate using mkcert #2188

Closed rodygosset closed 5 months ago

rodygosset commented 5 months ago

What version of drizzle-orm are you using?

0.30.9

What version of drizzle-kit are you using?

0.20.17

Describe the Bug

In a Next 14.2 App router project, using Vercel Postgres & @t3-oss/env-nextjs to validate env variables, running the app using bun dev works fine and the database connection is functional. The database is accessible on Vercel and can be queried successfully.

The problem is, when running bunx --bun drizzle-kit studio, I get a warning from bun: [bun] Warning: async_hooks.createHook is not implemented in Bun. Hooks can still be created but will never be called. Failed to find Response internal state key.

Despite this warning, I get the following message: Drizzle Studio is up and running on https://local.drizzle.studio

When trying to access Drizzle Studio at this URL, I get a loading screen and the console is logging errors concerning SSL: Access to XMLHttpRequest at 'https://localhost:4983/init' from origin 'https://local.drizzle.studio' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I'd had this error when I initially setup Drizzle Studio, and I got it working by following the mkcert install instructions as indicated in the Drizzle Studio loading screen. Now I get this error again and trying to run mkcert -install results in mkcert telling me the certificate is already installed.

Expected behavior

Running bunx --bun drizzle-kit studio starts Drizzle Studio, and it is accessible at https://local.drizzle.studio.

Environment & setup

No response

codewithbugs01 commented 5 months ago

I am getting the same error.