@databricks/sql@2.0.0 fails in CommonJS/Jest environments due to ESM uuid loaded via thrift
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
- Domain
- developer-experience, tooling
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-nodejs
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
engineer-bot
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
databricks/databricks-sql-nodejs#274 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in databricks/databricks-sql-nodejs
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 93/100
langgenius/dify#42764 · 1 reaction ·