Josh
Josh
Explore posts from servers
DTDrizzle Team
Created by Josh on 6/20/2024 in #help
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?
1 replies