Open gnllucena opened 9 months ago
I'm encountering a similar problem when running drizzle-kit studio
where my schema.ts
file has import "server-only"
that crashes the cli.
Issue persists on "drizzle-kit": "^0.20.14"
Repo updated
As a workaround, I was able to bypass the server-only
error when running drizzle-kit
commands. I'm not sure if this works with bun
though.
NODE_OPTIONS="--conditions=react-server" drizzle-kit ...
Relevant docs:
What version of
drizzle-orm
are you using?0.29.3
What version of
drizzle-kit
are you using?0.20.13
Describe the Bug
Clone repo https://github.com/gnllucena/drizzle-import-server-only
bun install
bun run migration:generate
The command will only create the
meta
folder and the_journal.json
file onsrc/server/data/migrations/
folder.If you remove the
import “server-only”
fromsrc/server/data/schema/customers-schema.ts
you’ll notice that the migrations are generated normally.Expected behavior
The migrations should be created when schema uses
import "server-only"
Environment & setup
OS: macOS 14.2.1 23C71 arm64 Kernel: 23.2.0 Shell: fish 3.5.0