Skip to content

void db generate fails with ERR_PACKAGE_PATH_NOT_EXPORTED for ./_db subpath #46

Closed

Description

@shulaoda

Description:

void db generate fails because drizzle-kit resolves the void/_db import using Node.js CJS require(), but the ./_db export in void/package.json only defines types and import conditions — no require condition.

Error:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './_db' is not defined by "exports" in .../node_modules/void/package.json
    at Module._findPath (node:internal/modules/cjs/loader:746:31)
    at nextResolveSimple (.../drizzle-kit/bin.cjs:15128:26)

Steps to reproduce:

  1. void init
  2. pnpm install
  3. void db generate

The command fails immediately with the error above.

Root cause:

drizzle-kit internally uses CJS require() to resolve the schema module. Node's CJS loader only matches the require export condition, which is missing from the ./_db (and likely ./_db-pg, ./_env) exports:

"./_db": {
  "types": "./dist/runtime/db.d.mts",
  "import": "./dist/runtime/db.mjs"
}

Environment:

  • void 0.2.0
  • drizzle-kit 0.31.10
  • Node.js 24.13.1 (ESM project, but drizzle-kit uses CJS internally)

Activity

  1. shulaoda commented on Mar 29, 2026

    @shulaoda
    MemberAuthor
    Image
  2. added a commit that references this issue on Apr 2, 2026
    2752fd0
  3. added a commit that references this issue on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions