# Uncaught ReferenceError: createRadio is not defined

**URL:** <https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075>\
**Category:** Beginners\
**Created:** [April 2, 2022, 11:40am UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075 "2022-04-02T11:40:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omri](https://avatars.discourse-cdn.com/v4/letter/o/bc79bd/32.png) [@Omri](https://discourse.processing.org/u/Omri)\
**Post date:** [April 2, 2022, 11:40am UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075/1 "2022-04-02T11:40:59Z")

</div>

Hey, I’m trying to use the createRadio() function, but I get this error:

```auto
Uncaught ReferenceError: createRadio is not defined
    at setup (p5js-temp-sketch_220402a1584838079584472986.js:4:3)
    at m.<anonymous> (p5.min.js:3:230028)
    at m.<anonymous> (p5.min.js:3:229048)
    at new m (p5.min.js:3:232427)
    at n (p5.min.js:3:226962)

```

my code:

```auto
let radio;

function setup() {
  radio = createRadio();
  radio.option('black');
  radio.option('white');
  radio.option('gray');
  radio.style('width', '60px');
  textAlign(CENTER);
  fill(255, 0, 0);
}

function draw() {
  let val = radio.value();
  background(val);
  text(val, width / 2, height / 2);
}

```

HTML file:

```auto
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
  <script language="javascript" type="text/javascript" src="libraries/p5.min.js"></script>
  <script language="javascript" type="text/javascript" src="p5js-temp-sketch_220402a1584838079584472986.js"></script>
  <!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->

  <!-- This line removes any default padding and style.
       You might only need one of these values set. -->
  <style> body { padding: 0; margin: 0; } </style>
</head>

<body>
</body>
</html>

```

Do you have any idea?  
Thanks 🙃

---

<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:** [April 2, 2022, 11:57am UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075/2 "2022-04-02T11:57:39Z")

</div>

That’s strange. Your code runs perfectly on my browser, which is Chrome on a MacBook Air.

 ![radio](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/f/7f0f896f5552d5bb4fbdc3328b2ac9a856162189.jpeg)

_EDIT (April 2, 2022):_

I did change the name of the sketch file, but that shouldn’t make a difference.

---

<div class="post-metadata">

**Author:** ![Omri](https://avatars.discourse-cdn.com/v4/letter/o/bc79bd/32.png) [@Omri](https://discourse.processing.org/u/Omri)\
**Post date:** [April 2, 2022, 12:38pm UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075/3 "2022-04-02T12:38:36Z")

</div>

Yes that’s strange, if I use the P5 web editor it’s working, but if i use the Processing 4 IDE (in the p5.js mode) it raise that error

---

<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:** [April 2, 2022, 12:45pm UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075/4 "2022-04-02T12:45:44Z")

</div>

Perhaps you have a corrupt local copy of the `p5.min.js` file installed. If so, a fresh download of it could address the problem.

---

<div class="post-metadata">

**Author:** ![Omri](https://avatars.discourse-cdn.com/v4/letter/o/bc79bd/32.png) [@Omri](https://discourse.processing.org/u/Omri)\
**Post date:** [April 2, 2022, 1:00pm UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075/5 "2022-04-02T13:00:26Z")

</div>

It worked!  
thank you!
