Prompt

Troubleshoot frontend error not showing stack trace

Technology / Observability1 observationLast seen Oct 20, 2026

Latest observation

Oct 20, 2026OpenAI APIWeb search: off

If a frontend error is not showing a stack trace, the usual causes are:

1) Source maps are disabled or unavailable

In production builds, minified code often hides useful traces unless source maps are enabled.

Check:

  • Chrome DevTools → Sources → see if *.map files load
  • Network tab → search for .map requests
  • Build config:
    • Webpack: devtool: 'source-map'
    • Vite: build: { sourcemap: true }
    • Create React App: source maps usually enabled unless GENERATE_SOURCEMAP=false

Fix:

Enable source maps in the frontend build.


2) The error is being caught and swallowed

A try/catch or global error handler may be preventing the stack from appearing.

Check for:

try {
  // ...
} catch (err) {
  console.error(err); // or missing this
}

Fix:

Make sure the error is logged properly:

catch (err) {
  console.error('Unexpected error:', err);
  throw err;
}

3) Logging only error.message instead of the full error

If you log just the message, you lose the stack.

Bad:

console.error(error.message);

Better:

console.error(error);

Or:

console.error('Error:', error.stack || error);

4) Errors from async code are not handled correctly

Promise rejections and async errors may not surface like normal exceptions.

Example:

async function loadData() {
  throw new Error('Failed');
}

If not awaited or caught, stack traces may not appear as expected.

Fix:

loadData().catch(err => console.error(err));

5) Framework error boundaries are masking the stack

React/Vue error handlers or boundaries may show only a generic message.

React:

Use an Error Boundary that logs the error:

componentDidCatch(error, info) {
  console.error(error, info);
}

6) Browser console settings hide source locations

Some browsers collapse stack traces or hide async details.

Check:

  • Console filters
  • “Preserve log”
  • “Async stack traces” enabled in DevTools settings

7) Production error reporting strips details

If using Sentry, Datadog, Rollbar, etc., the error may be sanitized or grouped.

Check:

  • Are you capturing error.stack?
  • Are source maps uploaded to the error service?
  • Is stack trace symbolication enabled?

8) The error object is not a real Error

Some libraries throw plain objects or strings, which may not include stack traces.

Bad:

throw 'Something failed';

Better:

throw new Error('Something failed');

Quick debugging checklist

  1. Reproduce in dev mode
  2. Open browser console and inspect the full error object
  3. Verify error.stack
  4. Confirm source maps are enabled
  5. Check if any catch/error boundary is swallowing the stack
  6. Confirm async errors are awaited/caught
  7. Test in another browser/profile

If you want, I can help you troubleshoot this for a specific stack like React / Next.js / Vue / Angular / Webpack / Vite.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.