Skip to content

A failed validate on a non-JSON module reports "Unsupported type" instead of the validation error #39

Closed

Description

@Shinrai

Problem

#33 / #35 made a failed validate on a loaded file throw the validation error, in the form Failed to load JSON file at <url>: @cldmv/wisp: <message>, instead of falling through to the fallback. For a non-JSON module (loaded through import() with a non-json type), a validate rejection still ends in wisp's generic "Unsupported type" error, so the caller can't tell their own validation rejected the data.

Found while porting the suite to vitest-runner (#37). The new tests pin the current behaviour.

Fix

Run validate outside the import-strategy error handling for every loader path, not only the JSON/fs path, so a validation rejection always surfaces as the validation error in the same format. Update the pinned test to expect the validation error.

Activity

  1. added
    type: bug
    priority: medium
    status: confirmed
    area: core
    on Oct 4, 2026
  2. added a commit that references this issue on Oct 4, 2026
    e944f48
  3. added
    status: implemented
    and removed
    status: confirmed
    on Oct 4, 2026
  4. cldmv-bot commented on Oct 4, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #41, merged into next. This issue closes automatically when that work ships to the default branch.

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

    area: corepriority: mediumstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions