Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async call in pre request causes console.info not a function error #4061

Closed
1 task done
hadarnexus opened this issue Feb 19, 2025 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@hadarnexus
Copy link

I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

Bruno version

1.39.0

Operating System

Windows

Describe the bug

I have an async script library file, which I invoke from a prerequest script. The prerequest script calls the method, then finishes processing itself. In the background, the script keeps processing. So I was trying to figure out a way to block until my method returns, however nothing I have tried so far works.
I then tried the following to see if async was possible in the prerequest script. But I get an error "console.info not a function error"

This is my pre request script to check async

`(async () => {
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

try {
    console.log("Starting async test...");
    await delay(10000); // Wait for 10 seconds
    console.log("Async test completed!");
} catch (error) {
    console.error("Async test failed:", error.message);
}

})();`

But I get this error

Error invoking remote method 'send-http-request': TypeError: console.info(...) is not a function

I am not using console.info anywhere, so assume its in the Bruno app code somewhere?

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Image

@hadarnexus hadarnexus added the bug Something isn't working label Feb 19, 2025
@hadarnexus
Copy link
Author

To fix the error, I needed to import axios. The prerequest script didnt block, but thats a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant