BabaYaga
BabaYaga
Explore posts from servers
DTDrizzle Team
Created by BabaYaga on 8/24/2023 in #help
drizzle-zod doesn't work with Array in pg
I'm using drizzle-orm, drizzle-kit & drizzle-zod in my application. One of my schema looks like following:
export const committee = pgTable("committee", {
id: text("id").primaryKey().notNull(),
safety_health: text("safety_health"),
safety_health_sources: text(
"safety_health_sources"
).array(),
// other properties
export const committee = pgTable("committee", {
id: text("id").primaryKey().notNull(),
safety_health: text("safety_health"),
safety_health_sources: text(
"safety_health_sources"
).array(),
// other properties
The schema works fine when I push, safety_health_sources is created as an array (No issues till this point) I create zod schema as well, like following:
export const committeeSchema = createSelectSchema(committee);
export const committeeSchema = createSelectSchema(committee);
and when I do:
type Committee = Partial<
z.infer<typeof committeeSchema>
>;
// the type become something like following
type Committee = {
id?: string | undefined;
safety_health?: string | null | undefined;
safety_health_sources?: string | null | undefined; // <--- The problem is here, it should be an Array<string>
// other properties
}
type Committee = Partial<
z.infer<typeof committeeSchema>
>;
// the type become something like following
type Committee = {
id?: string | undefined;
safety_health?: string | null | undefined;
safety_health_sources?: string | null | undefined; // <--- The problem is here, it should be an Array<string>
// other properties
}
6 replies
DTDrizzle Team
Created by BabaYaga on 7/15/2023 in #help
[Solved] Transforming const to the configured target environment ("es5") is not supported yet
So I had a old project, and I copied the DATABASE_URL and on created a basic drizzle project and drizzle.config.ts I got a schema created. Now, I copied the schema.ts file and pasted it into my new (second/another) project. I ran npx drizzle-kit generate:pg but I got the error Transforming const to the configured target environment ("es5") is not supported yet 55 times (55 is the number of tables that I have) 🥹 PLS HELP
2 replies
TTCTheo's Typesafe Cult
Created by BabaYaga on 3/25/2023 in #questions
Using Mantine instead of Tailwind gives useInsertionEffect Error
5 replies
TTCTheo's Typesafe Cult
Created by BabaYaga on 1/28/2023 in #questions
Failed to load next.config.mjs
When I run my T3 App, It shows Failed to load next.config.mjs
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /home/soodit/Documents/dev/prog/frontend-new/.env
error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/soodit/Documents/dev/prog/frontend-new/src/env/client.mjs' imported from /home/soodit/Documents/dev/prog/frontend-new/src/env/server.mjs
at new NodeError (node:internal/errors:400:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from /home/soodit/Documents/dev/prog/frontend-new/.env
error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/soodit/Documents/dev/prog/frontend-new/src/env/client.mjs' imported from /home/soodit/Documents/dev/prog/frontend-new/src/env/server.mjs
at new NodeError (node:internal/errors:400:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
2 replies