usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
24.96k stars 1.14k forks source link

Error invoking remote method 'send-http-request': TypeError: Cannot read properties of undefined (reading 'data') #2107

Open thegitty opened 4 months ago

thegitty commented 4 months ago

I have checked the following:

Describe the bug

Using Bruno 1.13.1. Trying to execute a POST-Request.

Getting the error (in the Response tab): "Error invoking remote method 'send-http-request': TypeError: Cannot read properties of undefined (reading 'data')"

Seems to be related to the response.

I get this error message when the server cannot be reached (e.g. missing VPN connection or not started local server and trying to access localhost).

Not a blocker, but did lead to confusion as the error message is not clear enough. Maybe this can be improved.

No message / error in console.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image
francesconi commented 4 months ago

Seems like baseUrl is undefined, so it's displayed in red. What URL is actually shown in the timeline tab?

thegitty commented 4 months ago

Seems like baseUrl is undefined, so it's displayed in red. What URL is actually shown in the timeline tab?

yes, when I took the screenshot I didn't select an according environment. I have updated the screenshot now, still having the same issue with a selected environment (timeline tab shows the complete url, no placeholder).

EDIT: I now was able to narrow it down, indeed it's not a major issue but did lead to confusion on my side. Did update the ticket.

Sorry for any inconvenience caused.

logicpeters commented 4 months ago

I just installed Bruno and also getting this same error with the first endpoint that I entered (the open-ai completion endpoint).

I am not sure where "data" is being referenced, but I am using a variable for my Open AI token, although the variable is showing as green, so I guess it is reading it correctly.

logicpeters commented 4 months ago

I think my issue ^ is related to the environment, as I was able to fix this by restarting Bruno and creating a new environment with my api token. Note that when I restarted Bruno, the initial environment that I created had disappeared. I tried to recreate the environment with the same name, and it threw an error. Only when I created a new environment with a different name did it create, and adding the api_token environment variable worked this second time.

spukkala commented 4 months ago

I am also getting the same error. I am running on v1.13.1 in windows.

assembler commented 4 months ago

I have the same issue. It was caused by SSL cert validation failure (issue with ZScaler). Error message should be definitely improved.

felixkamille commented 4 months ago

work around: disable "SSL/TLS Certificate Verification" via Bruno > Preferences > General

obicco commented 4 months ago

work around: disable "SSL/TLS Certificate Verification" via Bruno > Preferences > General

Thanks Felix, for me it worked!

lanes100 commented 3 months ago

Disabling SSL/TLS Certificate validation did not work for me. I'm still getting the error on my login request. Our certificat is old, but that is only because this is for a localhost instance. Not sure if there is another workaround. I'm getting the error for 'get' instead of 'data'

Mad0Cat commented 3 months ago

Problem is just as relevant. Disabling SSL/TLS Certificate did not help. It can be cured by restarting the application, but after 4-5 requests the error returns.

An example of a test where I have the same problem.

expect(jsonData.active[bru.getEnvVar("test")].status).to.eql("ACTIVE");

Cannot read properties of undefined (reading 'status')

CptnFizzbin commented 1 month ago

Same error message also appears when trying to send a https request to a http endpoint

saisnigdha93 commented 1 month ago

Faced same issue after importing postman collection which has code under Tests. Issue resolved after commenting script code under Tests.

eudennis commented 3 weeks ago

I had some issues with Postman tests too. Removing those fixed for me as well

xs-alpha commented 1 week ago

i have the same issue, but it do not appear in postman, holely shit