bruno icon indicating copy to clipboard operation
bruno copied to clipboard

TypeError: console.table is not a function

Open Gankarloo opened this issue 1 year ago • 3 comments

if I use "console.table()" in Pre och Post Requests The App shows this error: Error invoking remote method 'send-http-request': TypeError: console.table is not a function but it works as expected when run with the cli.

environment

Bruno v1.10.0 electron | : 21.1.1 chrome | : 106.0.5249.103 node | : 16.16.0 v8 | : 10.6.194.17-electron.0

Gankarloo avatar Mar 05 '24 13:03 Gankarloo

Interesting find, console gets overridden in electron, so all output can be sent into the browser window:

https://github.com/usebruno/bruno/blob/5f35d71b8ba5d8cb287ae5897cd4a6310006fe90/packages/bruno-js/src/runtime/test-runtime.js#L92-L104

But the real console object is used for CLI

Its-treason avatar Mar 05 '24 19:03 Its-treason

Do you think we should add all the console methods here @Its-treason? I'm not entirely sure.

sanjai0py avatar Mar 06 '24 06:03 sanjai0py

I'm not entirely sure either, but I think that would be better if we implement all methods, so the console behaves like expected.

Its-treason avatar Mar 06 '24 07:03 Its-treason