Type Declaration with TypeScript in Monorepo failes
I am trying to setup a monorepo with moon and pnpm, where shema lives in an additional package and is imported by other apps. Is there any monorepo example?
Currently I get following error:
There is an GitHub Issue already, can anyone help with workarounds or fixes, explanations?
https://github.com/drizzle-team/drizzle-orm/issues/656
GitHub
[BUG]:
"composite" true
and Yarn workspace prevents pgTable
fro...What version of drizzle-orm are you using? 0.26.1 What version of drizzle-kit are you using? 0.18.1 Describe the Bug TL;DR TypeScript can't compile simple schema.ts file with users example tabl...
3 Replies
if you dont compile your db package and you have
"main": "src/index.ts"
in your package.json, you can try "declaration": false
in your tsconfig, this may have downsides though
they also don't reccomend you install drizzle in more than one package in a monorepo, personally i just have a singular package which has an entrypoint that looks like this
https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189 this could be an useful comment for this issue
GitHub
"The inferred type of X cannot be named without a reference to Y" (...
Bug Report 🔎 Search Terms TS2742 cannot be named without a reference 🕗 Version & Regression Information Problems occurs with 4.5.x and 4.6.x and most likely earlier versions (I've tried a f...
Thanks, but while the linked comment seems to have workarounds, which do not work in this case.
Also disabling
declaration
is not possible because of the monorepo structure and composite: true
.
Re-Exporting the package is a good tipp, but sadly helps not with the TS error.