Skip to content

Troubleshooting

Anup Chavan edited this page Jun 21, 2026 · 1 revision

Troubleshooting

Use this page when a view is blank, the wrong files match, Bases rows are missing, or JavaScript fails.

The note is blank

Check these first:

  1. The active note matches the view rules.
  2. The view is above broader matching views in settings.
  3. The HTML template has balanced logic tags: {% if %} with {% endif %}, {% for %} with {% endfor %}.
  4. Open Developer Console and check for JavaScript errors.
  5. Temporarily disable the view's JavaScript.

Add a tiny marker to confirm the template runs:

<div>Custom Views rendered {{file.path}}</div>

The wrong view renders

Custom Views uses the first matching view. Move the intended view higher or make the earlier rule more specific.

A property is empty

Print the raw value near the top of the template:

<pre>{{file.properties}}</pre>
<pre>{{cover}}</pre>
<pre>{{artists}}</pre>

Then verify the property name and shape in the note frontmatter. Lists need indexes or joins:

{{cover[0]}}
{{artists|join:", "}}

if condition is not working

Use expression syntax in conditions, not pipe filters.

Instead of:

{% if row.values.artists|length > 1 %}

Use:

{% if row.values.artists.length > 1 %}

For album track artists, hide the row when there is only one artist or when the track artist is already the album artist:

{% set trackArtists = row.values.artists %}
{% if trackArtists.length > 1 and not trackArtists.contains(artists[0]) %}
  <div class="album-track-artists">{{trackArtists}}</div>
{% endif %}

Regex replacement does not work

Use expression syntax:

{{file.basename.replace(/.*\s*–\s*/, "")}}

Or pipe filter syntax:

{{file.basename|replace:"/.*\s*–\s*/":""}}

Make sure the dash is the same character. Ritviz – Mimmi uses an en dash, not a hyphen.

Bases returns 0 rows

Add debug output:

<pre>rows: {{bases.Songs.rowCount}}</pre>
<pre>error: {{bases.Songs.error}}</pre>

Then check:

  • The YAML block starts with views:.
  • Indentation is valid YAML.
  • The view name and access name are not confused. {% base "Songs" %} gives bases.Songs.
  • The filtered property has the expected type.
  • this points to the current note.

list(album).contains(this) gives no rows

This filter only works when song notes have an album property that links to the current album note.

Example song frontmatter:

---
album:
  - "[[Music/Love and Machines/Love and Machines|Love and Machines]]"
track: 1
artists:
  - "[[Artist Name]]"
---

If your song files store album names as plain text instead of links, change the Base filter to match your data shape.

JavaScript does not run

Check:

  1. Allow JavaScript execution is enabled.
  2. The script has no syntax error.
  3. DOM queries are scoped to this and run after the template exists.
  4. External fetches are not blocked or failing.

Use this temporary line:

console.log("Custom Views JS ran for", this);

Remove the log after debugging.

Image color sampling fails

Canvas sampling can fail for remote images because of CORS. Use crossorigin="anonymous" on images when possible and keep a fallback color.

<img class="album-cover" src="{{cover[0]}}" crossorigin="anonymous" alt="{{file.basename}}" />

Wikilinks render as plain text

Wikilinks render best in body content, not inside raw attributes. For links from Bases rows, prefer:

<div>{{row.file.link}}</div>
<div>{{row.values.artists}}</div>

Live preview feels slow

Try:

  • Reduce JavaScript work.
  • Remove large remote fetches from initial render.
  • Move related-file logic into a Bases query.
  • Avoid rendering huge {{file.content}} sections inside already-heavy views.

Wiki pages

Clone this wiki locally