drizzle-team / drizzle-team/drizzle-orm
[BUG]: Throwing server-only error on `drizzle-kit generate`
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Report hasn't been filed before.
- [x] I have verified that the bug I'm about to report hasn't been filed before.
### What version of `drizzle-orm` are you using?
0.40.0
### What version of `drizzle-kit` are you using?
0.30.5
### Other packages
_No response_
### Describe the Bug
```bash
$ npx drizzle-kit generate
```
outputs
```
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\myAppPath\circadia\packages\database\drizzle.config.ts'
Error: This module cannot be imported from a Client Component module. It should only be used from a Server Component.
at Object. (C:\myAppPath\node_modules\.pnpm\server-only@0.0.1\node_modules\server-only\index.js:1:7)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at newLoader (C:\myAppPath\node_modules\.pnpm\drizzle-kit@0.30.5\node_modules\drizzle-kit\bin.cjs:14151:13)
at Object.newLoader (C:\myAppPath\node_modules\.pnpm\drizzle-kit@0.30.5\node_modules\drizzle-kit\bin.cjs:14151:13)
at extensions..js (C:\myAppPath\node_modules\.pnpm\drizzle-kit@0.30.5\node_modules\drizzle-kit\bin.cjs:16679:28)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
```
I'm using [Turborepo](turbo.build), and my project is built with [Next-Forge](next-forge.com). I got a `Please install latest version of drizzle-orm` error when using `pnpx` instead of `npx` (idk why), but it seems `npx` is at least a step closer.
Contributor guide
Assessment
This issue has not been assessed yet.