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.htmlin 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 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, 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:
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:
- 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; Upload a ZIP in the Template Editor opens your ZIP there without saving it
- ZIP contains
index.htmlandstyles.cssat the root, everything else underassets/ - File size reasonable — a few megabytes; a single file over 50 MB is refused
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 |
| 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, 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 and Template JavaScript best practices |
| Upload refused | Packaging rule or static-analysis error | The message says which; the packaging rules are on Template library, the analysis checks on What the static analysis checks |
| 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 |
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.