Doesn't drizzle-kit generate:pg work yet when schema imports from esm package?
Building from TS to ESM JS works fine.
9 Replies
Do you have anything else in file with schemas except of tables/enums?
Yes but removing extras (Error class and InferModels) does not fix it. I'm using own esm package to reexport drizzle-orm exports to have single drizzle-orm defined in the project. I run into some weird TS errors when I installed drizzle-orm separately to every app.
@project1/database-drizzle-orm is an esm package reexporting drizzle stuff and some helper functions.
At least would be great to be able to import
helper functions from esm helper package into schema file.
Do you have multiple
drizzle-orm
packages installed in 1 project?
Also in your error I see import { drizzle } from "drizzle-orm/node-postgres";
error, but can't see it here
If you could provide small project example with structure you are using - I can take a look and help you or find the reason why drizzle-kit
is not working in this case
You can do really simple small example. Important is to have same structure you have in your projectProvided minimum reproducible example under comments of https://github.com/drizzle-team/drizzle-kit-mirror/issues/21
GitHub
Issue when generating sql using zod for environment variable valida...
When using npx drizzle-kit generate:mysql with other source for env variables, an error is thrown. npx drizzle-kit generate:mysql drizzle-kit: v0.17.0 drizzle-orm: v0.22.0-88c1ad3 /home/stneto/apps...
Thanks a lot! Will test it tomorrow and ping you back here
Did reproduce it
working on it
Hi. Any update on this? Can I help somehow? This issue is the last issue keeping us using TypeORM.
We have also same problem related to that when we want to use ESM packages what we have made.
Did you find something? @Andrew Sherman
could you please share drizzle-orm and drizzle-kit versions you are using?
@Andrew Sherman
Project example is here https://github.com/drizzle-team/drizzle-kit-mirror/issues/21
drizzle-orm: "^0.23.1" and no drizzle-kit
GitHub
Issue when generating sql using zod for environment variable valida...
When using npx drizzle-kit generate:mysql with other source for env variables, an error is thrown. npx drizzle-kit generate:mysql drizzle-kit: v0.17.0 drizzle-orm: v0.22.0-88c1ad3 /home/stneto/apps...