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
sps15mo 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/drizzle-zod@0.2.1_drizzle-orm@0.26.0_zod@3.21.4/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/drizzle-zod@0.2.1_drizzle-orm@0.26.0_zod@3.21.4/node_modules/drizzle-zod/index.js:6:24:
6 │ const utils_1 = require("drizzle-orm/utils");
╵ ~~~~~~~~~~~~~~~~~~~
Andrii Sherman
Andrii Sherman15mo ago
Looking into it
sps
sps15mo 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
Andrii Sherman15mo ago
I guess it’s zod release bug I will have a chance to check a bit later today and get back to you
sps
sps15mo 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
Andrii Sherman15mo ago
Try to upgrade Zod to latest and check drizzle-zod I mean
sps
sps15mo 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
Andrii Sherman15mo ago
just import it from "drizzle-orm"
sps
sps15mo ago
Working fine now, 🙏
Want results from more Discord servers?
Add your server
More Posts