# Simple Rocket.jl example: Error in Timer

**URL:** <https://discourse.julialang.org/t/simple-rocket-jl-example-error-in-timer/97281>\
**Category:** New to Julia\
**Created:** [April 9, 2023, 4:00pm UTC](https://discourse.julialang.org/t/simple-rocket-jl-example-error-in-timer/97281 "2023-04-09T16:00:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [April 9, 2023, 4:00pm UTC](https://discourse.julialang.org/t/simple-rocket-jl-example-error-in-timer/97281/1 "2023-04-09T16:00:24Z")

</div>

Hello people

I am currently working with the package Rocket.jl and would like to run the sample code at [GitHub - biaslab/Rocket.jl: Functional reactive programming extensions library for Julia](https://github.com/biaslab/Rocket.jl)

but the following code always brings an error message.

```julia
using Rocket, Compose, IJulia ; set_default_graphic_size(35cm, 2cm)

function draw_ball(t)
    IJulia.clear_output(true)
    x = -exp(-0.01t) + 1 # x coordinate
    y = -abs(exp(-0.04t)*(cos(0.1t))) + 0.83 # y coordinate
    display(compose(context(), circle(x, y, 0.01)))
end

source = interval(20) |> take(200) # Take only first 200 emissions

subscription = subscribe!(source, draw_ball)

```

Message under WIN11 - Julia 1.8.5:

```julia
 TimerSubscription()
Error in Timer:

```

What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![bvdmitri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bvdmitri/32/22935_2.png) [@bvdmitri](https://discourse.julialang.org/u/bvdmitri)\
**Post date:** [April 17, 2023, 6:49am UTC](https://discourse.julialang.org/t/simple-rocket-jl-example-error-in-timer/97281/2 "2023-04-17T06:49:20Z")

</div>

Hey @Ralf_Dietrich ,

In what environment are you trying to run this code? It is supposed to work only in Jupyter notebook.

---

<div class="post-metadata">

**Author:** ![Ralf\_Dietrich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralf_dietrich/32/5643_2.png) [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Post date:** [April 17, 2023, 6:09pm UTC](https://discourse.julialang.org/t/simple-rocket-jl-example-error-in-timer/97281/3 "2023-04-17T18:09:23Z")

</div>

Your hint put me on the right track. Thank you very much.

1. I have now run the code under VSCode as ipynb file.
2. The code does not work here either because of a bug that is already reported ([Undefined reference when using `clear_output` · Issue #1066 · JuliaLang/IJulia.jl · GitHub](https://github.com/JuliaLang/IJulia.jl/issues/1066))
3. I deleted the line that causes the bug, then you can run the program as a flipbook and you get at least an impression what it should do originally. ==\> Just delete the line `IJulia.clear_output(true)`
