Skip to content

Markdown preview fails with "marked(): input parameter is of type [object Number]" #9453

@AmmarKazi

Description

@AmmarKazi

Expected Behavior

The "Preview" tab in the request pane should safely render the description, or handle non-string values gracefully without showing a library error.

Actual Behavior

When a request has a description field set to a Number (e.g. via a malformed import or database state), clicking the "Preview" tab shows the following error:
Failed to render: marked(): input parameter is of type [object Number], string expected

Image

Reproduction Steps

  1. Import a request with a numeric description (e.g., "description": 12345 in the JSON import).
  2. Open the request.
  3. Click the Docs or Preview tab.
  4. Observe the error message.

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

Context

This seems related to loose data validation on the description field. The marked library expects a string but is receiving a number.

Possible Solutions

I see two ways to resolve this:

Option 1: Defensive Casting (UI Level) - Recommended
We can explicitly cast the value to a string right before passing it to the marked() library.

  • Pros: Prevents the UI error immediately without risking data loss.
  • Cons: Doesn't fix the underlying "dirty data".

Option 2: Strict Validation (Import/Model Level)
Update the import logic or the Request model schema to reject or automatically convert non-string descriptions when data enters the application.

  • Pros: Ensures data consistency.
  • Cons: Might block users from importing older/legacy exports if the validation is too strict.

Insomnia Version

12.1.0

What operating system are you using?

macOS

Operating System Version

Sequoia 15.2

Installation method

insomnia.rest

Last Known Working Insomnia version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-bugBug: general classificationS-unverifiedStatus: Unverified by maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions