# Inconsistent Pluto behaviour - some cache to clean?

**URL:** <https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083>\
**Category:** New to Julia\
**Tags:** visualization, pluto\
**Created:** [August 27, 2021, 7:50am UTC](https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083 "2021-08-27T07:50:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hacklint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hacklint/32/25568_2.png) [@hacklint](https://discourse.julialang.org/u/hacklint)\
**Post date:** [August 27, 2021, 7:50am UTC](https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083/1 "2021-08-27T07:50:47Z")

</div>

Hi,  
Using WGLMaki in Pluto and tried following the thread [here](https://discourse.julialang.org/t/recent-errors-with-wglmakie-on-pluto/64859/8)  
My issue is that I seem to get different behaviour in different workbooks.  
Starting a fresh workbook and adding the minimal example of

```julia
using WGLMakie, JSServe
Page()

```

and  
`scatter(1:4)`  
in separate cells work, producing the expected plot.

However, adding this at the beginning of another workbook that is “kind of” working in that it does produce plots but requires eg scatter to be prefixed as `WGLMakie.scatter(1:4)` does _not_ work, complaining about both Page and scatter being undefined.

Had similar behaviour with other workbooks before where one worked (producing plots) the other did not - but copying cell by cell from non-working to working workbook did work. (Phew, that’s s lot of work…😉

So I start to wonder if there is some non-obvious cache or other state in a workbook that may need clearing to sort this out? Having to copy things into a working “seed” workbook does not really feel like a viable option for more than a very small proof of concept.

Currently running

```julia
  [824d6782] JSServe v1.2.3
  [c3e4b0f8] Pluto v0.15.1
  [276b4fcb] WGLMakie v0.4.5

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 27, 2021, 8:35am UTC](https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083/2 "2021-08-27T08:35:25Z")

</div>

There shouldn’t be any hidden state/cache anywhere. You haven’t provided a reproducible example, but what you describe sounds like a simple name clash, i.e. in your “bigger” notebooks you are using more packages which export the same names as the functions you are trying to use. Example:

```julia
julia> using Plots, CairoMakie

julia> scatter(rand(10), rand(10))
WARNING: both CairoMakie and Plots export "scatter"; uses of it in module Main must be qualified
ERROR: UndefVarError: scatter not defined

```

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [August 27, 2021, 12:16pm UTC](https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083/3 "2021-08-27T12:16:32Z")

</div>

An additional point:  
`Page()` is just manipulating a global state, but it has no explicit input/ output variable. Therefore, Pluto cannot determine when this function has to be executed.  
To fix this, put it into a cell with other statements where the execution order is defined, e.g.

```julia
begin
using WGLMakie, JSServe # using statements are executed first
Page()
end

```

---

<div class="post-metadata">

**Author:** ![hacklint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hacklint/32/25568_2.png) [@hacklint](https://discourse.julialang.org/u/hacklint)\
**Post date:** [August 27, 2021, 12:23pm UTC](https://discourse.julialang.org/t/inconsistent-pluto-behaviour-some-cache-to-clean/67083/4 "2021-08-27T12:23:13Z")

</div>

Yes, doing this (with begin/end in the first cell of the workbook)
