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.
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.