# Setup method runs twice

**URL:** <https://discourse.processing.org/t/setup-method-runs-twice/21275>\
**Category:** Coding Questions\
**Created:** [May 25, 2020, 11:30am UTC](https://discourse.processing.org/t/setup-method-runs-twice/21275 "2020-05-25T11:30:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dansumption](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/dansumption/32/9365_2.png) [@dansumption](https://discourse.processing.org/u/dansumption)\
**Post date:** [July 2, 2020, 6:36pm UTC](https://discourse.processing.org/t/setup-method-runs-twice/21275/4 "2020-07-02T18:36:17Z")

</div>

In case anyone else encounters this problem, I finally managed to solve it, and it was down to the way that I wasn instantiating processing and assigning the `setup` and `draw` methods. I’ve documented it in this thread: [How to access p5js functions when using ES6 modules](https://discourse.processing.org/t/how-to-access-p5js-functions-when-using-es6-modules/21359/)

---

_[View the full topic](https://discourse.processing.org/t/setup-method-runs-twice/21275)._
