Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

@databricks/[email protected] fails in CommonJS/Jest environments due to ESM uuid loaded via thrift

未關閉
#461 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
58/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
nodejs, typescript

研究方向

從 lib/index.ts 開始,重現 mocks/@databricks/sql.js 中所示 CommonJS/Jest 路徑的模組載入失敗。追蹤 @databricks/sql -> thrift -> uuid/dist-node/index.js 鏈結,並將行為與 1.17.x 版本進行比較。當 @databricks/[email protected] 能在不使用自訂 ESM 轉換的情況下於 CommonJS/Jest 中載入,且測試能夠執行時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

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/[email protected].

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/[email protected] 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)

主要語言
TypeScript
星號
37
分支
52
平均合併
1 天 47 分鐘
30 天內合併 PR
10

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/databricks-sql-nodejs 的其他 Issue

查看 databricks/databricks-sql-nodejs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。