hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

[BUG] `ssrRewriteStacktrace` throws line error, obfuscates actual error

Open dduupp opened this issue 3 years ago • 0 comments

Describe the bug

Something is wrong when Vite rewrites the stack trace, causing the actual error to not be visible.

To Reproduce

I added prop-types here without specifying it in optimizeDeps config, forcing an error: https://stackblitz.com/edit/shopify-hydrogen-j8njrq?file=src%2Fcomponents%2Felements%2FButton.jsx&title=Hydrogen

  1. Create a new Hydrogen app
  2. Force an error
  3. Run yarn dev
  4. See error '[vite] Internal server error: line must be greater than 0 (lines start at line 1)'

Expected behaviour The correct error stack trace is shown, instead of the stack trace rewrite line error.

Screenshots

Screenshot 2022-08-30 at 11 06 57

Additional context

  • Hydrogen version 1.3.0
  • Node version 16

dduupp avatar Aug 30 '22 09:08 dduupp