# Unable to get console output with p5.js mode in Processing IDE

**URL:** https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691
**Category:** Beginners
**Created:** [January 17, 2022, 7:11am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691 "2022-01-17T07:11:15Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 17, 2022, 7:11am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/1 "2022-01-17T07:11:15Z")

</div>

For some reason I am unable to get console output in Processing using p5.js mode. Nothing shows up in the Processing window or in the web output screen.

```auto
function setup() {
  createCanvas(400, 400);
  background(220);
  console.log("console log setup");
  print("print setup");
}

function draw() {
  console.log("console log draw");
  print("print draw");
}

```

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [January 17, 2022, 9:30am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/3 "2022-01-17T09:30:35Z")

</div>

When it is opened, do you get any output in the JavaScript console of your browser?

The following is from a MacBook Air with macOS Monterey, Processing 4.0b2, and Chrome:

 ![p5.js console.log](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c19f0c0f3cad05b455d6d35857cdb759b951901f.jpeg)

What configuration do you have on your system?

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 17, 2022, 2:53pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/4 "2022-01-17T14:53:51Z")

</div>

```auto
do you get any output in the JavaScript console of your browser

```

No, and that’s a problem. I’m using macOS Big Sur version 11.6, Processing 4.0b2, and Safari on a Mac mini(2018). Here’s what I see:

 ![browser](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/12382e0732794ca569d8cd77614c4e0dcff2d728.png)

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [January 17, 2022, 3:15pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/5 "2022-01-17T15:15:48Z")

</div>

What do you see in Safari, running without the Processing IDE, if you open a JavaScript console, and view an HTML file that references your sketch?

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 17, 2022, 4:10pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/6 "2022-01-17T16:10:53Z")

</div>

```auto
if you open a JavaScript console, and view an HTML file that references your sketch?

```

Unfortunately, I’m ignorant about all of this. How would I open a JavaScript console? I do have experience with p5.js web editor and OpenProcessing, but I’m accustomed to using the Processing IDE and prefer to use it if I can get some output. However, it’s really hard to debug code if I can’t see console output.

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 17, 2022, 4:22pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/7 "2022-01-17T16:22:02Z")

</div>

I did a google search and came up with this: [https://balsamiq.com/support/faqs/browserconsole/](https://balsamiq.com/support/faqs/browserconsole/). I was able to see some html code. How would I connect this to Processing IDE?

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 17, 2022, 4:43pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/8 "2022-01-17T16:43:10Z")

</div>

Okay, I get it. Once Processing IDE has run I need to add the js console to the browser window that it supplies:

 ![browser_2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/15c97421252990687a5c3d8708f1481682ef24a5.png)

And there’s all my console output from the demo. Thanks a million.

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [January 17, 2022, 5:19pm UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/9 "2022-01-17T17:19:22Z")

</div>

> [@svan](#):
>
> Once Processing IDE has run I need to add the js console to the browser window …

Yeah, it was all about isolating the source of the problem.

in p5.js Mode, when you click the Run button, the job gets handed over to the browser. Then it is up to the browser to read the HTML, and render the page and manage the JavaScript console, according to the linked p5.js library, the linked sketch script, and any CSS that might be linked in or embedded. So, at that stage it becomes unlikely the the problem is with the Processing IDE itself. That sends our focus to the browser or the code for the source of the problem. The code looks good, so that leaves the browser, including its settings.

_EDITED on January 17, 2022 to add a couple of sentences to the above._

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 21, 2022, 6:35am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/10 "2022-01-21T06:35:05Z")

</div>

```auto
in p5.js Mode, when you click the Run button, the job gets handed over to the browser.

```

Is there any way to change the browser that it is handed over to?

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [January 21, 2022, 7:33am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/11 "2022-01-21T07:33:34Z")

</div>

You could change your default browser, but the one you choose would become the default for opening all HTML files, even outside the Processing Development Environment.

See the following:

> **[Change the default web browser or email app on your Mac](https://support.apple.com/en-us/HT201607)**
>
> Choose which app opens when you click a website link or email address.

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 21, 2022, 7:54am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691/12 "2022-01-21T07:54:36Z")

</div>

```auto
change your default browser

```

I was trying to avoid that if I could. No good solution it seems. I’ve been having trouble with some p5.js code not running in Safari, while it will run in Chrome. The only other option would be to use a different p5.js editor in lieu of Processing (assuming that I could direct its output to Chrome). I think Dan Shiffman has his set up that way (at least it looks like it in his videos).
