drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
23.49k stars 577 forks source link

[BUG]: using any Drizzle-zod function in Workerd's (CFW runtime) would crash #2493

Closed carafelix closed 3 months ago

carafelix commented 3 months ago

What version of drizzle-orm are you using?

drizzle-orm@0.32.

What version of drizzle-kit are you using?

No response

Describe the Bug

Importing and using any function exported by drizzle-zod, ex:

export const dummy = createSelectSchema(apiUserTable);

in any type or form will cause throwing. apiUserTable:

export const apiUserTable = pgTable("api_user", {
  id: char("id", { length: 26 }).primaryKey(),
});

Sadly the error isn't verbose at all.

✘ [ERROR] service core:user:myApi: Uncaught TypeError: Cannot read properties of undefined (reading 'nullable')

    at null.<anonymous> (index.js:18207:36) in b2
    at null.<anonymous> (index.js:18318:13)

✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

Expected behavior

No response

Environment & setup

No response

carafelix commented 3 months ago

skill issue