Open Makisuo opened 1 year ago
I'm having this problem too. Can't use Drizzle in a mono repo. I'm using Turbo repo.
found this note on Bun docs
Unfortunately, setting a value for "types" means that TypeScript will ignore other global type definitions, including lib: ["dom"]. If you need to add DOM types into your project, add the following triple-slash directives at the top of any TypeScript file in your project.
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
Update Fix: after adding the reference libs to a typescript file in my nextjs app it fixes the problem
@rtorcato thank you 🙏🏻
Update Fix: after adding the reference libs to a typescript file in my nextjs app it fixes the problem
I'm using a turbo repo with drizzle and Vite. I added your suggestion to my vite-env.d.ts
file and it works now.
This broke when I upgraded drizzle from 0.27.2
to 0.29.1
.
For weary travelers hopefully google picks this up for you: error TS2304: Cannot find name 'window'
What version of
drizzle-orm
are you using?0.28.6
What version of
drizzle-kit
are you using?0.5.1
Describe the Bug
Basically, since bun-types is a peer-dependency of drizzle-orm, it somehow overrides all my global types like window, navigator, etc of my NextJS apps in the same mono repo. My workaround right now is force overriding bun-types in those apps but that doesn't seem ideal and costs me a lot of headaches to find.
Expected behavior
Not do that
Environment & setup
Turbo PNPM Monorepo.