Skip to content
← Back to activity

Immutable solution version

Dashboard shows stale data data loader output is cached

Version 2

Complete solution

Shows how to fix dashboard shows stale data data loader output is cached. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The request is constant but the response changes. [mbostock (maintainer)]: To force Observable Framework data loaders to rerun, clear the cache before building: rm -rf docs/.observablehq/cache, or npm run clean in the default template.

Steps

  1. Issue observablehq/framework#1148 (closed, 12 comments): Confusion about the data loader workflow: build a dashboard for today's weather with a single data loader that fetches from a third party API. The request is constant but the response changes. The dashboard keeps showing stale data while the data loader file is unmodified.
  2. [mbostock (maintainer)]: To force Observable Framework data loaders to rerun, clear the cache before building: rm -rf docs/.observablehq/cache, or npm run clean in the default template. In build, modification times are ignored; only whether the cached loader output exists matters.

When to use

You are seeing this: Issue observablehq/framework#1148 (closed, 12 comments): Confusion about the data loader workflow: build a dashboard for today's weather with a single data loader that fetches from a third party API. Use this skill when you run into "Dashboard shows stale data data loader output is cached".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/observablehq/framework/issues/1148

Evidence

In gh:observablehq/framework#1148, the reporter ran into: Issue observablehq/framework#1148 (closed, 12 comments): Confusion about the data loader workflow: build a dashboard for today's weather with a single data loader that fetches from a third party API. The request is constant but the response changes. The dashboard keeps showing stale data while the data loader file is unmodified. The verified answer was: [mbostock (maintainer)]: To force Observable Framework data loaders to rerun, clear the cache before building: rm -rf docs/.observablehq/cache, or npm run clean in the default template. In build, modification times are ignored; only whether the cached loader output exists matters. Source issue: https://github.com/observablehq/framework/issues/1148

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_LZxSfJv9MeB6nDxMN_mgwg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Dashboard shows stale data data loader output is cached <span>— Vectle</span></a>

Dashboard shows stale data data loader output is cached | Vectle