Skip to content

Grid.Item content using data64 encoded SVG not working on Windows #22082

Closed

Description

@j3lte

Description

It seems images that are encoded as base64 strings are not working in Raycast for Windows. See the following screenshot for this extension (I worked on):

Image

It does not seem to be an issue with the extension, but the API (I tried to debug it extensively), hence why it is reported as an API bug

Technical explanation:

  • Every unicode symbol is shown as a GridItem, see here
  • For both dark and light, an SVG is generated here
  • This SVG is base64 encoded and used as an Image.Source
  • This works perfectly fine on Mac, but it doesn't work on Windows. For Windows, when I use the List mode (see Preferences), it works, so Windows can use the character.

Environment

  • Raycast version: 0.32.2.0
  • OS: Windows 11 Pro (build: 26100.6584)

Steps To Reproduce

  • On Windows, install the Unicode Symbols Search extension
  • Open the extension in grid mode (default)

Current Behaviour

  • Every Grid item is empty

Expected Behaviour

  • It should show the SVG that is encoded as a base64 image, like on Mac (see screenshots in store)

Activity

  1. added
    bug
    on Oct 10, 2025
  2. added theissue type on Oct 10, 2025
  3. added
    api
    on Oct 10, 2025
  4. j3lte commented on Oct 10, 2025

    @j3lte
    ContributorAuthor

    Update: I have checked another extension, Font Awesome, which does work with a base64 encoded SVG. The problem is most likely that it cannot handle the <text> element. This is the template string that is used to generate an SVG:

    export const getSquareSVGString = (value: string, dark = false) => {
      let val = value;
      if (value === "&") {
        val = "&amp;";
      } else if (value === "<") {
        val = "&lt;";
      } else if (value === ">") {
        val = "&gt;";
      }
      const textColor = dark ? "#fff" : "#000";
      const size = 200;
      return `
      <svg height="${size}" width="${size}">
        <rect fill="transparent" x="0" y="0" width="${size}" height="${size}"></rect>
        <text x="${size / 2}" y="${
          size / 1.3
        }" fill="${textColor}" text-anchor="middle" alignment-baseline="central" font-size="${
          size / 2
        }" line-height="0" font-family="mono-space">${val}</text>
      </svg>
      `;
    };
  5. j3lte commented on Oct 11, 2025

    @j3lte
    ContributorAuthor

    After a long search, it appears it has to do with the interpretation of SVGs. I had to add the xmlsto the svg tag to get it working.

    <svg height="${size}" width="${size}" xmlns="http://www.w3.org/2000/svg">

    Closing the issue

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

    apibug

    Type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions