Drizzle kit generate gives error after upgrade

I have updated drizzle-orm to 0.26.0 and drizzle-kit to 018.0. I have defined relations according to the docs, to use the relational queries. When I run drizzle-kit generate:sqlite, I am getting this error




9 Replies
SPS | Shootmail
SPS | ShootmailOP2y ago
I guess some exports related to drizzle-zod and drizzle-orm/errors have changed. And these are related I am getting build errors after updating to 0.26.0
X [ERROR] Could not resolve "drizzle-orm/errors"

src/helpers/exceptions.ts:1:29:
1 │ import { DrizzleError } from "drizzle-orm/errors";
╵ ~~~~~~~~~~~~~~~~~~~~

The path "./errors" is not exported by package "drizzle-orm":

node_modules/drizzle-orm/package.json:153:13:
153 │ "exports": {
╵ ^

You can mark the path "drizzle-orm/errors" as external to exclude it from the bundle, which will remove this error.
X [ERROR] Could not resolve "drizzle-orm/errors"

src/helpers/exceptions.ts:1:29:
1 │ import { DrizzleError } from "drizzle-orm/errors";
╵ ~~~~~~~~~~~~~~~~~~~~

The path "./errors" is not exported by package "drizzle-orm":

node_modules/drizzle-orm/package.json:153:13:
153 │ "exports": {
╵ ^

You can mark the path "drizzle-orm/errors" as external to exclude it from the bundle, which will remove this error.
Could not resolve "drizzle-orm/utils"

node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/drizzle-zod/index.js:6:24:
6 │ const utils_1 = require("drizzle-orm/utils");
╵ ~~~~~~~~~~~~~~~~~~~
Could not resolve "drizzle-orm/utils"

node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/drizzle-zod/index.js:6:24:
6 │ const utils_1 = require("drizzle-orm/utils");
╵ ~~~~~~~~~~~~~~~~~~~
Andrii Sherman
Looking into it
SPS | Shootmail
SPS | ShootmailOP2y ago
Hi @Andrew Sherman Is this a bug in the new release or am I doing something wrong? Were you able to check this?
Andrii Sherman
I guess it’s zod release bug I will have a chance to check a bit later today and get back to you
SPS | Shootmail
SPS | ShootmailOP2y ago
Oh alright, sure import { DrizzleError } from "drizzle-orm/errors"; This import here also seems to be absent in the new release has this been removed in favor of something else? Hey @Andrew Sherman is this fixed?
Andrii Sherman
Try to upgrade Zod to latest and check drizzle-zod I mean
SPS | Shootmail
SPS | ShootmailOP2y ago
Sure will try that. However, this import is from drizzle-orm
import { DrizzleError } from "drizzle-orm/errors";
import { DrizzleError } from "drizzle-orm/errors";
Any suggestions on what to change this to fix this?
Andrii Sherman
just import it from "drizzle-orm"
SPS | Shootmail
SPS | ShootmailOP2y ago
Working fine now, 🙏
Want results from more Discord servers?
Add your server