> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Stack traces – Error Tracking pocket guide Canonical URL: https://posthog.com/learn/error-tracking/pocket-guide/stack-traces > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). Chapter 02 # Stack traces – Error Tracking pocket guide The **Trip details** exception is in PostHog, but its stack trace points to Twig's minified code, so the engineers can't tell which line failed Fig. 1. TypeError Cannot read properties of undefined (reading 'name') - readTripHost/\_next/static/chunks/app/profile/page-a1b2c3.js@1:482131 - openTripDetails/\_next/static/chunks/app/profile/page-a1b2c3.js@1:61877 - renderWithHooks/\_next/static/chunks/framework-d4e5f6.js@1:5654 - performUnitOfWork/\_next/static/chunks/framework-d4e5f6.js@1:125612 Fig. 1 – Without source maps, every frame points into a bundle. Twig's web app is a minified React bundle. An app that uses one of these frameworks likely has the same issue: - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/js.svg)Web](https://posthog.com/docs/error-tracking/upload-source-maps/web.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/frameworks/nextjs.svg)Next.js](https://posthog.com/docs/error-tracking/upload-source-maps/nextjs.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/nodejs.svg)Node.js](https://posthog.com/docs/error-tracking/upload-source-maps/node.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/react.svg)React](https://posthog.com/docs/error-tracking/upload-source-maps/react.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/docs/integrate/frameworks/angular.svg)Angular](https://posthog.com/docs/error-tracking/upload-source-maps/angular.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/frameworks/nuxt.svg)Nuxt](https://posthog.com/docs/error-tracking/upload-source-maps/nuxt.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/react.svg)React Native](https://posthog.com/docs/error-tracking/upload-source-maps/react-native.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/Android_robot_bec2fb7318.svg)Android](https://posthog.com/docs/error-tracking/upload-mappings/android.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/flutter.svg)Flutter](https://posthog.com/docs/error-tracking/upload-source-maps/flutter.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/go.svg)Go](https://posthog.com/docs/error-tracking/upload-source-maps/go.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/ios.svg)iOS](https://posthog.com/docs/error-tracking/upload-source-maps/ios.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/kmp.svg)Kotlin Multiplatform](https://posthog.com/docs/error-tracking/upload-debug-symbols/kmp.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/rust.svg)Rust](https://posthog.com/docs/error-tracking/upload-source-maps/rust.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/Rollup_js_c306a2fde3.svg)Rollup](https://posthog.com/docs/error-tracking/upload-source-maps/rollup.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/webpack_3fc774b5a5.svg)Webpack](https://posthog.com/docs/error-tracking/upload-source-maps/webpack.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/Vitejs_logo_98ffe5d5ee.svg)Vite](https://posthog.com/docs/error-tracking/upload-source-maps/vite.md) - [CLI](https://posthog.com/docs/error-tracking/upload-source-maps/cli.md) - [![](https://res.cloudinary.com/dmukukwp6/image/upload/github_mark_903e35d471.svg)GitHub Action](https://posthog.com/docs/error-tracking/upload-source-maps/github-actions.md) ## Source map uploads The engineers set up [source map](https://posthog.com/docs/error-tracking/upload-source-maps.md) uploads for Twig's source code to get full stack traces. PostHog can get the maps three ways: | Option | Trade-off | | --- | --- | | Upload in CI | The default. The source stays private, and each build uploads its own maps. | | Host them publicly | No upload step, but anyone can read the source. | | Embed them in the bundle | No upload, but users download larger files and can read the source. | The engineers link each upload to a [release](https://posthog.com/docs/error-tracking/releases.md). PostHog then shows the version and commit on every trace. With a [GitHub or GitLab integration](https://posthog.com/docs/error-tracking/integrations.md), it also links each frame to the file and line in `PostHog/twig.com`. The engineers upload source maps in CI, which keeps Twig's source private. The Error Tracking Wizard sets up the upload step, so each build uploads its own maps. The **Trip details** trace now points at the failing line in `readTripHost`, in `src/trips/trip-details.ts` Fig. 2. TypeError Cannot read properties of undefined (reading 'name') - readTripHostsrc/trips/trip-details.ts@12:201 10export function readTripHost(hosts: Record, hostId: string) { 11 const host = hosts\[hostId\] 12 const hostName = host.name 13 return hostName 14} - openTripDetailssrc/account/AccountPages.tsx@42:18 - renderWithHooksnode\_modules/react-dom/client.js@5654:242 - performUnitOfWorknode\_modules/react-dom/client.js@12561:98 Fig. 2 – With source maps, the same trace opens on the failing line in Twig's source code. Twig's own frames show at the top, and dependency frames carry a box icon. ## Breadcrumbs Breadcrumbs, which PostHog calls exception steps, hold context that only matters if something breaks. The engineers call `addExceptionStep` at checkpoints like a retry or a fallback path. The SDK attaches the steps to the next exception, and they show up in the issue's **Timeline** tab Fig. 3. - 09:14:02/account/trips1 - 09:14:06open\_trip\_detailsstay\_id stay-022 - 09:14:07read\_trip\_hostsurface trip\_details - 09:14:07TypeErrorCannot read properties of undefined (reading 'name')3 - 09:14:19/account/trips exceptionexception steppageview Fig. 3 – The Timeline tab shows your recorded steps in order, next to everything else in the session. If no exception happens, the SDK discards the steps, so successful runs cost nothing. The engineers pick where context goes by when they'll need it: | Record it as | When | | --- | --- | | An exception step | It only matters if this run fails | | A log | The team wants it kept for every run, failed or not | | A property on the exception | The team wants to filter, group, assign, or count issues by it | | An event | The team wants to count the action on its own | Steps work in the ![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/js.svg) [web](https://posthog.com/docs/error-tracking/installation/web.md), ![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/react.svg) [React Native](https://posthog.com/docs/error-tracking/installation/react-native.md), ![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/ios.svg) [iOS](https://posthog.com/docs/error-tracking/installation/ios.md), ![](https://res.cloudinary.com/dmukukwp6/image/upload/Android_robot_bec2fb7318.svg) [Android](https://posthog.com/docs/error-tracking/installation/android.md), and ![](https://res.cloudinary.com/dmukukwp6/image/upload/posthog.com/contents/images/docs/integrate/flutter.svg) [Flutter](https://posthog.com/docs/error-tracking/installation/flutter.md) SDKs. [Check your symbol sets](https://app.posthog.com/error_tracking/configuration#selectedSetting=error-tracking-symbol-sets)After your next build, find your latest upload in the list. [Issue grouping →](https://posthog.com/learn/error-tracking/pocket-guide/issue-grouping.md) **Explore further** [Stack traces](https://posthog.com/docs/error-tracking/stack-traces.md) · [Upload source maps](https://posthog.com/docs/error-tracking/upload-source-maps.md) · [Releases](https://posthog.com/docs/error-tracking/releases.md)