# cell error when loading page

**URL:** <https://talk.observablehq.com/t/cell-error-when-loading-page/7671>\
**Category:** Feedback\
**Created:** [March 1, 2023, 2:54am UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671 "2023-03-01T02:54:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fatemeh](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fatemeh](https://talk.observablehq.com/u/Fatemeh)\
**Post date:** [March 1, 2023, 2:54am UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/1 "2023-03-01T02:54:28Z")

</div>

Hello

I worked on my project, and everything appears to work correctly. When I reload the page, it seems that one or more cells do not run, so I see an error. And by running that cell again, I can see the correct output. Do you have any ideas how I can fix it? I was thinking of a while loop as an example.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [March 1, 2023, 5:39am UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/2 "2023-03-01T05:39:56Z")

</div>

This can sometimes occur if you’re relying on cross-cell mutation (side effects). I wrote a little about that here:

> **[Don’t Do This](https://observablehq.com/@observablehq/dont-do-this)**
>
> Or do (it’s fine!) but consider these alternatives… Here are some common tips in Observable, inspired by Postgres. Don’t write giant text cells. Why not? If you have a “wall of text” (a lot of Markdown) in a single cell, you lose the ability to move...

If you’d like to share your notebook, we might be able to provide more specific guidance.

---

<div class="post-metadata">

**Author:** ![Fatemeh](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fatemeh](https://talk.observablehq.com/u/Fatemeh)\
**Post date:** [March 1, 2023, 3:45pm UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/3 "2023-03-01T15:45:18Z")

</div>

Thank you so much for your response. here is my code [HW2 / Fatemeh Nazari | Observable](https://observablehq.com/d/05e9c935a7190c11)

most of the time i have problem with the radar chart.

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [March 1, 2023, 4:02pm UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/4 "2023-03-01T16:02:04Z")

</div>

As Mike indicated, you’ve got a side effect that needs to finish before your visualizations can run. In particular, the cell that looks like so

```
{
   // in this cell we want to add calculated similarity column, for each car, with the BMW 2002
  data.forEach((element) => { 
    ... 
  }
}

```

processes and modifies the data to make some changes that are necessary for the visualizations. To fix this, you can name that cell and then refer to that value in the cells that require it. Perhaps something like:

```
process = {
   // in this cell we want to add calculated similarity column, for each car, with the BMW 2002
  data.forEach((element) => { 
    ... 
  }
}

```

Then,

```
Radar_Chart = {
  process;
  var margin = { top: 100, right: 100, bottom: 100, left: 100 },
    ...
}

```

---

<div class="post-metadata">

**Author:** ![Fatemeh](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fatemeh](https://talk.observablehq.com/u/Fatemeh)\
**Post date:** [March 1, 2023, 4:20pm UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/5 "2023-03-01T16:20:29Z")

</div>

great! that worked perfectly. I would appreciate it if you could tell me how to do that for my scatter plot because sometimes I have the same problem there too.

---

<div class="post-metadata">

**Author:** ![Fatemeh](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fatemeh](https://talk.observablehq.com/u/Fatemeh)\
**Post date:** [March 1, 2023, 4:24pm UTC](https://talk.observablehq.com/t/cell-error-when-loading-page/7671/6 "2023-03-01T16:24:23Z")

</div>

I think I could fix that one too. Thank you and Mike for the tips.
