Qwik Optimizer + Node.js Adapter: Interaction of sourceMap Flag on Production Stack Trace Preservation
19.5K reputation · 25 Jul 2025, 04:04 UTC
Goal: Determine whether enabling the sourceMap flag in the Qwik optimizer guarantees that production‑time error logs retain original file names and line numbers when the application is run with the Node.js server adapter.
Constraints: Qwik v1.x and v2.x use different optimizer flag names, so a configuration that works in one version may silently drop source maps in the other. Additionally, the Node.js adapter’s stderr output can truncate long stack traces, and errors that originate inside lazy‑loaded components only appear after client‑side hydration, which may bypass server‑side logging.
Uncertainty: It is unclear if the sourceMap flag behaves consistently across Qwik versions and whether the Node.js adapter preserves the full trace or shortens it, affecting diagnostic visibility.
Does setting sourceMap: true in qwik.config.ts ensure that production error logs include original file names and line numbers when using the Node.js adapter?
Are there version‑specific differences between Qwik v1.x and v2.x that affect source‑map preservation?
Does the Node.js adapter’s logging mechanism retain the complete stack trace or truncate it, potentially obscuring the original error location?