Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)41k · #6868

diagnosing-stacktrace-symbolication

Skill này làm gì

Skill này hỗ trợ khi báo cáo lỗi hiển thị mã đã bị thu nhỏ hoặc làm rối, không đọc được. Nó dành cho lập trình viên cần PostHog hiển thị tên file và số dòng dễ đọc.

Khi nào nên dùng

  • ✓Khi báo cáo lỗi của bạn hiển thị tên mã bị thu nhỏ thay vì tên file và số dòng dễ đọc.
  • ✓Khi stack trace lỗi React Native, Android hoặc iOS không được chuyển ngược lại thành mã dễ đọc.
  • ✓Khi bạn đã tải lên source map hoặc file symbol nhưng lỗi vẫn hiển thị khó đọc.

Liên kết skill

https://github.com/PostHog/posthog/blob/master/products/error_tracking/skills/diagnosing-stacktrace-symbolication/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/PostHog/posthog/blob/master/products/error_tracking/skills/diagnosing-stacktrace-symbolication/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Lỗi JavaScript của tôi trong PostHog hiển thị mã bị thu nhỏ. Làm sao để chúng đọc được trở lại?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra theo thứ tự: thiết lập build, các file symbol được tạo, việc tải lên PostHog, và lỗi đã được ghi lại. Hầu hết vấn đề xuất hiện ở một trong bốn bước này.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Diagnosing stack-trace symbolication

Symbolication is the cross-platform name for what JavaScript source-map lookup, Hermes function-offset resolution, Proguard / R8 demangling, and dSYM address-to-line lookup all do — turn a minified or obfuscated frame back into a readable file, function, and line.

Work through the user's build and PostHog symbol sets as one pipeline: build config -> generated symbol artifacts (JavaScript source maps, Hermes maps, Proguard mappings, or dSYM bundles) -> uploaded symbol set in PostHog -> captured error frame. Most failures become obvious once those four pieces are checked in order.

Platforms

Platform Symbol-data type Reference
JavaScript / TypeScript web source-and-map javascript.md
React Native (Hermes) hermes coming soon
Android (Proguard / R8) proguard coming soon
iOS / macOS (dSYM) apple-dsym coming soon

Step 3 of the workflow (symbol-set lookup in PostHog) is identical across platforms — posthog-cli symbol-sets extract handles all four container types. Steps 1, 2, and the platform-specific failure modes live in the per-platform reference.

Workflow

Step 1 - Find how symbol data is produced and uploaded

Look at the app repo's build scripts and PostHog upload config. Confirm which PostHog package handles the upload (@posthog/rollup-plugin, @posthog/webpack-plugin, @posthog/nextjs-config, @posthog/nuxt, or direct posthog-cli) and which directory or asset it processes. See the platform reference for build-tool-specific config inspection.

For debugging, prefer a build where symbol artifacts remain on disk after upload so you can compare local artifacts against what PostHog received. JavaScript example with the Vite plugin (the platform reference covers the equivalent setting for other build tools):

sourcemaps: {
  enabled: true,
  deleteAfterUpload: false,
}

Step 2 - Build and inspect local artifacts

Run the production build that uploads symbols, then inspect the emitted files locally. The exact files and helper invocation differ per platform — see the platform reference for the helper command, expected file shape, and common build-time pitfalls (notably empty-mappings false positives that look like upload bugs but are actually bundler config issues).

If local artifacts already look wrong, fix the build before debugging the PostHog upload.

Step 3 - Check symbol sets in PostHog

Look up the symbol set whose ref matches the captured frame's chunk_id using the dedicated MCP tools — they handle auth, project scoping, and pagination automatically:

  • posthog:error-tracking-symbol-sets-list with ref=<chunk_id> returns the matching row.
  • posthog:error-tracking-symbol-sets-retrieve with the ID returns the same shape (and confirms permissions).
  • posthog:error-tracking-symbol-sets-download-retrieve returns a one-hour presigned URL pointing at the uploaded symbol-data file. Download it immediately; do not echo the URL back unless the user explicitly asks.

If MCP access is not available, the same data is in Project settings > Error tracking > Symbol sets in the PostHog UI.

Interpret the row:

  • ref must match the captured frame chunk_id.
  • last_used updating means PostHog found and loaded that symbol set. It does not guarantee the frame resolved.
  • has_uploaded_file: false means the upload did not complete.
  • A non-null failure_reason means PostHog could not parse or load the uploaded symbol data.

The downloaded file is a PostHog symbol-data container (compressed Rust-encoded payload), not plain JSON. Extract it with posthog-cli:

posthog-cli symbol-sets extract symbolset.bin -o ./extracted
# or, without installing globally:
#   npx @posthog/cli symbol-sets extract symbolset.bin -o ./extracted
#   bunx @posthog/cli symbol-sets extract symbolset.bin -o ./extracted

posthog-cli symbol-sets extract handles all four symbol-set types (source-and-map, hermes, proguard, dSYM) and writes the extracted files into the output directory. Once extracted, summarize using the platform reference's helper.

Step 4 - Compare local, uploaded, and served

Câu hỏi thường gặp

Skill bao gồm những nền tảng nào?

Nó bao gồm JavaScript và TypeScript cho web một cách chi tiết. React Native, Android và iOS được nhắc đến, nhưng hướng dẫn cho các nền tảng này vẫn đang được bổ sung.

Symbol set là gì?

Đó là một file được tải lên PostHog, ánh xạ mã đã biên dịch trở lại tên gốc và số dòng gốc.

Nếu nền tảng của tôi không có trong danh sách thì sao?

Skill nói rằng hướng dẫn cho các nền tảng khác sắp có, nên bạn có thể chỉ nhận được các bước chung.

Chi tiết

Mô tả gốc của tác giả

Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM). The PostHog symbol-set lookup flow is universal across platforms; build-tool and artifact details live in per-platform references (JavaScript is fleshed out, others come as we encounter them). Use when stack frames stay minified or obfuscated after symbols are uploaded, PostHog symbol sets show last_used but frames are not readable, chunk IDs or dSYM UUIDs do not match, "Token not found" appears, uploade

repo: PostHog/posthog

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6868
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự