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
24.41k stars 639 forks source link

[BUG]: #2838

Open jsbroks opened 2 months ago

jsbroks commented 2 months ago

What version of drizzle-orm are you using?

v0.30.10

What version of drizzle-kit are you using?

v0.21.4

Describe the Bug

Error: Cannot find module './workspace.js'
// schema/index.ts
export * from "./workspace.js";
export default defineConfig({
  schema: "./src/schema",
  dialect: "postgresql",
  dbCredentials: { url: nonPoolingUrl },
})

Drizzle generate/push does not work with typescript files importing with .js

Expected behavior

No response

Environment & setup

No response

misium commented 2 months ago

I just ran into this too.

Probably should be filed as a drizzle-kit bug not drizzle-orm. Looks like a dupe of drizzle-team/drizzle-kit#462.

There's a temp fix in that thread too -- shoutout @mandarzope for reporting the issue and a fix at the same time.