fsIntegration crashes in native ESM when patching the read-only fs namespace
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 68/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
- 領域
- backend
研究方向
先在原生 ESM 中執行最小重現,接著檢查對應於 build/esm/integrations/fs/vendored/instrumentation.js 的原始碼,特別是 _patchMethod 以及它如何匯入 fs。完成的標準是 fsIntegration 在原生 ESM 中初始化時不會當機;請確認 CommonJS 變通方案仍可運作。
由索引模型根據 Issue 內容生成。
描述
Environment
@sentry/node11.10.0- Node.js 24.22.1, Linux x64
- Native ESM, no bundler
Minimal reproduction
import { fsIntegration } from '@sentry/node';
fsIntegration().setupOnce?.();
Run with node --input-type=module (or save as .mjs). The same failure occurs when registering fsIntegration() through Sentry.init().
Actual behavior
The process throws asynchronously:
TypeError: Cannot assign to read only property 'accessSync' of object '[object Module]'
The stack points to _patchMethod in build/esm/integrations/fs/vendored/instrumentation.js.
Expected behavior
Filesystem instrumentation initializes in native ESM without crashing.
Cause and workaround
The ESM implementation imports * as fs from 'fs' and then assigns wrappers to that read-only module namespace. Loading the integration from the public CommonJS build with createRequire() works. Using the mutable default fs export fixes the crash; calling syncBuiltinESMExports() afterward also refreshes named ESM bindings.
- 主要語言
- TypeScript
- 星號
- 8.8k
- 分支
- 1.9k
- 平均合併
- 1 天 19 小時
- 30 天內合併 PR
- 664
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-javascript 的其他 Issue
-
Bug Package: node Spans vercel ai
難度 2/5 1-3 小時 新手友好度 73/100
getsentry/sentry-javascript#26079 · 1 則留言 ·
維護者通常 1 天內回覆
-
Browser Bug
難度 2/5 1-3 小時 新手友好度 85/100
getsentry/sentry-javascript#25946 · 2 則留言 ·
維護者通常 1 天內回覆
-
normalize() throws when a getter throws a Symbol or a null-prototype object可能已有人在做 @rjmcgee53192 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-javascript#25920 · 2 則留言 ·
維護者通常 1 天內回覆
-
Only create Nuxt database and storage spans when there is a parent span可能已有人在做 @nicohrubec 於 5 天前認領。 未關閉Improvement Nuxt
難度 2/5 1-3 小時 新手友好度 83/100
getsentry/sentry-javascript#25805 · 2 則留言 ·
維護者通常 1 天內回覆
-
Only create Cloudflare storage and D1 db spans when there is a parent span可能已有人在做 @nicohrubec 於 5 天前認領。 未關閉Cloudflare Workers Improvement Spans
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-javascript#25804 · 1 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
Add: Yichang TV未關閉check:passed streams:add
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
vtselect: data race in Tempo search tags APIs for invalid TraceQL queries可能已有人在做 @Shubham19032004 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
VictoriaMetrics/VictoriaTraces#304 ·
維護者通常 1 天內回覆
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)未關閉
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/vscode-pull-request-github#9159 ·
維護者通常 1 天內回覆
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info only未關閉enhancement from-x
難度 2/5 1-3 小時 新手友好度 66/100
nightly-labs/openbot#4867 ·
維護者通常 1 天內回覆