# Console.log in pre request script is not showing in async

**URL:** <https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543>\
**Category:** Help Hub\
**Tags:** console, pre-request-script\
**Created:** [September 28, 2023, 12:37pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543 "2023-09-28T12:37:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![telecoms-physicist11](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@telecoms-physicist11](https://community.postman.com/u/telecoms-physicist11)\
**Post date:** [September 28, 2023, 12:37pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543/1 "2023-09-28T12:37:49Z")

</div>

`console.log()` in pre request script is not showing in the postman console

I create a collection with a pre-request script below

```js
console.log('test1')

(async function main() {
    console.log('test2')
})();

```

And we create a request in this collection and send a request.

There is a error show below

```auto
TypeError: console.log(...) is not a function

```

Version 10.18.9  
UI Version: 10.18.9-ui-230926-0710  
Desktop Platform Version: 10.18.7 (10.18.7)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 28, 2023, 12:41pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543/2 "2023-09-28T12:41:38Z")

</div>

Hey @telecoms-physicist11 👋

Welcome to the Postman Community! :postman:

Without further context about how your using that statement (I can think of a lot) or any kind of visual examples to show what you’re seeing on your side - It’s going to be extremely difficult for anyone to help you here.

Please use this topic as a guide on [how to best ask questions](https://community.postman.com/t/how-to-best-ask-questions-on-community-to-get-the-answers-you-need/16912) on the forum.

---

<div class="post-metadata">

**Author:** ![telecoms-physicist11](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@telecoms-physicist11](https://community.postman.com/u/telecoms-physicist11)\
**Post date:** [September 28, 2023, 1:06pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543/3 "2023-09-28T13:06:04Z")

</div>

@danny-dainton Thanks for reminder. I updated my question

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [September 28, 2023, 2:07pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543/4 "2023-09-28T14:07:44Z")

</div>

You are missing the semi colon at the end of the first console log to terminate that command.

```auto
console.log('test1');

(async function main() {
    console.log('test2')
})();

```

![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/0/1082324275b955b89f0728120e6c930469133b41.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [October 1, 2023, 2:08pm UTC](https://community.postman.com/t/console-log-in-pre-request-script-is-not-showing-in-async/52543/5 "2023-10-01T14:08:23Z")

</div>

Closed on October 1, 2023, 2:08pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
