Skip to content

Display rules crash when rendering GeoJSON/GPX path embeds — Object.keys(null) in Query.testIdentifier #404

Description

@Graham3324

Summary
When the vault has any property/tag-based display rule (e.g. [type:foo]), embedding a GeoJSON or GPX path (![[route.gpx]]) throws an uncaught TypeError and the path never renders. Map View parses the track fine (it logs initialized with … markers & paths), but the display-rule pass over the path layer crashes on Object.keys(null).

Environment
Map View: 6.1.4 (latest)
Obsidian: 1.12.7, macOS 26.5.1
Setting Handle supported path embeds (handlePathEmbeds): on
Steps to reproduce
In Map View settings, add a display rule with a property/tag query, e.g. [type:national-park] (in my vault this is one of ~35 auto-generated per-type pin rules).
Add any track file to the vault — route.gpx or route.geojson with a LineString.
In a note, embed it: ![[route.gpx]].
Open the note in reading view.
Expected
The path renders as a line, and display rules either apply gracefully to path features or are skipped for them.

Actual
No line renders — the embedded map falls back to a default (world/US) view with no auto-fit — and the console throws:

Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Object.keys ()
at Query.testIdentifier (plugin:obsidian-map-view:64135:41)
at Query.testLayer (plugin:obsidian-map-view:64023:37)
at DisplayRulesCache.runOn (plugin:obsidian-map-view:78454:27)
at GeoJsonLayer.runDisplayRules (plugin:obsidian-map-view:47991:59)
at buildGeoJsonLayers (plugin:obsidian-map-view:48119:15)
at async MapViewPlugin.updateMarkersWithRelationToFile (plugin:obsidian-map-view:81188:37)
One error fires per path embed on the page.

Additional findings (narrowing it down)
Not file-specific: a hand-authored GeoJSON with an explicit non-empty properties object ({"name":…,"stroke":…}) throws the identical stack — so it's the display-rule evaluation on the path layer, not missing feature properties.
Markers are unaffected: normal note markers render correctly under the same display rules; only GeoJSON/GPX path layers crash.
Parsing succeeds: the crash is at display-rule evaluation (GeoJsonLayer.runDisplayRules), after the path is loaded.
Likely cause: Query.testIdentifier calls Object.keys(...) on a value that is null/undefined for path features (which lack the frontmatter/tag identifier map that note markers have). A guard there — or skipping identifier-based display rules for path features — would likely resolve it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p0Critical

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions