Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

@databricks/sql@2.0.0 fails in CommonJS/Jest environments due to ESM uuid loaded via thrift

Open
#461 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start at lib/index.ts and reproduce the module-load failure from the CommonJS/Jest path shown in mocks/@databricks/sql.js. Trace the @databricks/sql -> thrift -> uuid/dist-node/index.js chain and compare behavior with version 1.17.x. Done means @databricks/sql@2.0.0 loads in CommonJS/Jest without custom ESM transforms and tests execute.

Written by the indexing model from the issue text.

Description

Summary

After upgrading @databricks/sql from 1.17.x to 2.0.0, our Jest-based test suite started failing during module load.

The failure happens when @databricks/sql is required from a CommonJS environment. The import chain reaches thrift/node_modules/uuid/dist-node/index.js, which is ESM, and Jest then throws a syntax error.

This did not happen with @databricks/sql@1.17.x.

Error

.../node_modules/thrift/node_modules/uuid/dist-node/index.js:1
export { default as MAX } from './max.js';
^^^^^^

SyntaxError: Unexpected token 'export'

Relevant stack excerpt:

at Object. (node_modules/@databricks/sql/lib/index.ts:4:1)
at Object.require (mocks/@databricks/sql.js:7:25)

Expected behavior

@databricks/sql should be loadable in CommonJS/Jest environments without requiring consumers to add custom ESM transforms for transitive dependencies.

Actual behavior

Loading @databricks/sql@2.0.0 causes Jest to parse an ESM file from a transitive dependency (uuid under thrift) and fail before tests execute.

Notes

This appears to be related to packaging/module compatibility in the dependency chain:

@databricks/sql -> thrift -> uuid/dist-node/index.js (ESM)

Dominant language
TypeScript
Stars
36
Forks
50
Avg merge
13h 46m
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

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.

More from databricks/databricks-sql-nodejs

All issues in databricks/databricks-sql-nodejs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.