---
description: Checking a template before it goes on a sign — local and in-app previews, full-screen and resolution tests, long-running tests, the pre-upload checklist, and the usual causes of fonts, images, overflow, stutter and "works locally but not on the sign".
---

# Testing and troubleshooting templates

A template that looks right in a browser tab can still fail on a sign: a font that loaded
from the internet, an image path with the wrong case, an animation that stutters on a small
player, a timer that leaks for a day. This page is the test routine and the usual causes.

## Where to test

- **Locally** — open `index.html` in Chrome (or serve it with an editor's live-preview
  extension). Data-bound fields are empty here; the layout, assets and animations are what
  you check.
- **In the app** — upload the template and click its **title** in the
  [template library](template_library.md) to open the preview dialog. A Current Item
  template opens without data until you turn on **Enable preview editing**, which fills
  its fields with generated sample data that you can edit as JSON beside the preview; a
  Room Scoped template gets a generated sample schedule straight away, without the editor,
  and an Event Scoped template its event's real schedule. Or open it in the
  [Template Editor](template_editor_analysis.md), where the preview can take any size:
  for a Current Item or Room Scoped template, pick a room under **Data source** to swap
  the sample data for that room's real schedule; for an Event Scoped template, switch
  between **Real event data** and **Sample data** and set a **Preview time** to see a
  chosen moment. **Preview Template in a New Tab** in the row menu opens the template
  full-size on its own, with the same data as the dialog, except that a Current Item
  template is filled with sample data straight away.
- **On a sign** — assign it to a test room and open the room's sign URL on the real device
  or in a kiosk Chrome. Signs run Chrome; test in Chrome.

Test full-screen (F11) and at the exact screen size: in Chrome's developer tools (F12), the
device toolbar (Ctrl+Shift+M) lets you enter 1920 × 1080 or 1080 × 1920 and flip the
orientation. Check that nothing scrolls, nothing is cut off and every asset loads (the
**Console** and **Network** tabs show 404s).

### Long-running tests

Signs run for days. Leave the template open for at least half an hour and watch Chrome's
task manager (Shift+Esc) for memory that keeps growing, animations that degrade, and timers
that pile up. A quick uptime counter in the console helps:

```js
let startTime = Date.now();
setInterval(() => {
  console.log(`Template running for ${Math.floor((Date.now() - startTime) / 60000)} minutes`);
}, 60000);
```

Remove it before uploading, or use `ctx.setInterval` inside `preseriaTemplateInit` so it is
cleaned up with the template.

## Checklist before uploading

Before uploading, verify each item:

<div class="checklist" markdown>

- Displays correctly at the target resolution, full-screen, no scrollbars
- All assets load — no broken images or fallback fonts
- No external dependencies (CDN links, remote fonts, external APIs)
- Animations run smoothly
- Tested for at least 30 minutes of continuous runtime without growing memory
- Readable from the viewing distance of the real screen
- No console errors
- Nothing under **Won't work as written** in [Validate Template](template_editor_analysis.md#validate-template); **Upload a ZIP** in the **Template Editor** opens your ZIP there without saving it
- ZIP contains `index.html` and `styles.css` at the root, everything else under `assets/`
- File size reasonable — a few megabytes; a single file over 50 MB is refused

</div>

## Common problems

| Symptom | Usual cause | Fix |
| --- | --- | --- |
| Text shows in a fallback font | Font loaded from a CDN, or the `@font-face` path is wrong | Bundle the font under `assets/fonts` and use a relative `src:` — see [Fonts](basic/font_configuration.md) |
| Broken image icons | Wrong relative path, or a case mismatch (`Logo.png` vs `logo.png`) | Check the path and the exact file name; the console shows the 404 |
| White borders, or black around the edges | Body or container not filling the viewport | Use the base template's `body` and `.your-content` CSS; keep the body black and `overflow: hidden` on the container |
| Content cut off or overflowing | Content longer than the design assumed | Set explicit container sizes with `overflow: hidden`, test with the longest expected titles |
| Animations stutter | JavaScript animation, or animating layout properties | Use CSS animations on `transform` and `opacity`; reduce simultaneous animations and image sizes |
| Works locally, not on the sign | Absolute paths, external resources, or files missing from the ZIP | Relative paths only, bundle everything, compare the ZIP's file list with the references in `index.html` |
| An element never shows, or always shows | A `data-condition` that doesn't do what it looks like it does, or a field the items don't have | Run [Validate Template](template_editor_analysis.md#validate-template), and try **Check against** |
| Fields are empty on the sign | Wrong `data-field` path, or the template reads the DOM before the player has bound it | Check the field name on the item's JSON page; read values inside `preseriaTemplateInit` — see [Displaying JSON values](basic/json_value_configuration.md) and [Template JavaScript best practices](advanced/template-js-best-practices.md) |
| Upload refused | Packaging rule or static-analysis error | The message says which; the packaging rules are on [Template library](template_library.md#what-the-upload-checks), the analysis checks on [What the static analysis checks](static_analysis.md) |
| Upload fails with "Template storage already contains files for template id …" | The server's template files are out of step with its database, for example after a database restore | Nothing was deleted and your ZIP was not saved; report the message to support, who clear the leftover files for that id, then upload again |
| Sign still shows the template as it was before a replacement | The sign has not picked up the change yet | A sign checks for template changes every 15 seconds and then re-caches the files; give it a minute, then reload the sign's browser if it is still stale — see [How digital signs work](../signs/digital_sign_info.md) |

If the problem is not here, check the sign's browser console first. When you ask whoever
runs your Onlit installation for help, send the template ZIP, a screenshot of the sign and
the console errors with the question.

## Related

- [Getting started with templates](getting_started.md)
- [Template library](template_library.md)
- [Template Editor and analysis](template_editor_analysis.md)
- [Template JavaScript best practices](advanced/template-js-best-practices.md)
