sidecar icon indicating copy to clipboard operation
sidecar copied to clipboard

Nodejs Trace is cut off.

Open Froelund opened this issue 1 year ago • 0 comments

First of all - thanks for building and maintaining Sidecar 🙏

Past few days I've been digging to figure out where this issue came from

Lambda Execution Exception for App\Services\Sidecar\SSRFunction: "Cannot read properties of undefined (reading 'welcome.search'). [TRACE] TypeError: Cannot read properties of undefined (reading 'welcome.search') at new f (/var/task/node_modules/ziggy-js/dist/index.js:1:4399) at route (/var/task/node_modules/ziggy-js/dist/index.js:1:7770)".

I've enabled source-maps, but with no luck. I could not find the source of the issue. In the end, I found that when SettleResult builds the error message, it only includes 3 elements from the stack.

https://github.com/hammerstonedev/sidecar/blob/5d1e03bd023962287aab61870a152f9d150c83c0/src/Results/SettledResult.php#L199

After changing that line to $trace = $this->trace();, I easily found the bug.

Seems limiting to slice the trace and I suggest to just add the entire trace to the error message

Froelund avatar Sep 24 '23 18:09 Froelund