DT
Drizzle Teamā€¢6mo ago
Josh

NodeNext Module Resolution Causes `drizzle-kit generate` to fail.

Hiiiiii šŸ‘‹ , I'm having trouble using the kit with "moduleResuolution": "NodeNext". Basicaly that means that in my typescript files I import modules like the following: File tree:
src/schema
ā”œā”€ā”€ asset.ts
ā””ā”€ā”€ users.ts
src/schema
ā”œā”€ā”€ asset.ts
ā””ā”€ā”€ users.ts
Code:
// "moduleResuolution": "NodeNext" (What i'm using)
import { users } from './users.js'; // It's not a mistake that it is `.js` and not `.ts`

// "moduleResuolution": "Node" (Old way)
import { users } from './users';
// "moduleResuolution": "NodeNext" (What i'm using)
import { users } from './users.js'; // It's not a mistake that it is `.js` and not `.ts`

// "moduleResuolution": "Node" (Old way)
import { users } from './users';
This causes drizzle-kit to not be able to generate my schema.
> drizzle-kit generate

drizzle-kit: v0.22.7
drizzle-orm: v0.31.2

No config path provided, using default 'drizzle.config.ts'
Reading config file '/app/drizzle.config.ts'
Error: Cannot find module './asset.js'
Require stack:
- /app/src/schema/users.ts
- /app/node_modules/drizzle-kit/bin.cjs
> drizzle-kit generate

drizzle-kit: v0.22.7
drizzle-orm: v0.31.2

No config path provided, using default 'drizzle.config.ts'
Reading config file '/app/drizzle.config.ts'
Error: Cannot find module './asset.js'
Require stack:
- /app/src/schema/users.ts
- /app/node_modules/drizzle-kit/bin.cjs
Is there any solutions to this issue without modifying source files?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server