weaviate / weaviate/typescript-client

weaviate-client v3.13+ CJS build broken: nested uuid v10 dependency causes ERR_REQUIRE_ESM at runtime

Open
#436 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
101
Forks
38
Avg merge
4d 12h
Merged PRs (30d)
2

Description

After upgrading weaviate-client, the service fails on startup with:

Error [ERR_REQUIRE_ESM]: require() of ES Module
.../node_modules/weaviate-client/node_modules/uuid/dist-node/index.js
from .../weaviate-client/dist/node/cjs/collections/deserialize/index.js not supported.
Root cause

weaviate-client ships a CJS build (dist/node/cjs/) but has a nested dependency on uuid v10, which dropped CommonJS support and is now pure ESM. When Node resolves require('uuid') inside the CJS build, it finds the nested uuid v10 copy and fails.

Workaround

Manually delete the nested uuid after install:

rm -rf node_modules/weaviate-client/node_modules/uuid
This forces resolution to fall back to a top-level uuid v9 if present.

Expected behavior

The CJS build should be fully usable from a CommonJS project without workarounds. Either the internal uuid dependency should be pinned to v9, or the CJS build should use dynamic import() for uuid calls.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the startup failure from a CommonJS project and inspect dist/node/cjs/collections/deserialize/index.js together with the internal uuid dependency resolution. Verify the CJS build works without deleting the nested package, then run the existing build or test commands to confirm the ERR_REQUIRE_ESM failure is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.