Skip to content

SVG icons render with empty width/height attributes causing console errors #5442

@NBBorislavMalinov

Description

@NBBorislavMalinov

Description

When clicking on wallet connectors in the AppKit modal, SVG icons are rendered with empty width="" and height="" attributes, causing browser console errors.

Error Message

Error: <svg> attribute width: Unexpected end of attribute. Expected length, "".
Error: <svg> attribute height: Unexpected end of attribute. Expected length, "".

Stack Trace

j @ 6499.13ae89e6d3459ff0.js:3
_$AI @ 6499.13ae89e6d3459ff0.js:3
p @ 6499.13ae89e6d3459ff0.js:3
...
onClickConnector @ 4380-4879305d5198bb74.js:4735
handleEvent @ 4380-4879305d5198bb74.js:2206

Environment

  • @reown/appkit version: 1.8.15
  • @reown/appkit-adapter-wagmi: 1.0.4
  • Browser: Chrome 131
  • Framework: Next.js 15.5.9

Steps to Reproduce

  1. Open a page with AppKit wallet connect modal
  2. Click on a wallet connector (e.g., MetaMask, WalletConnect)
  3. Open browser DevTools Console
  4. Observe SVG attribute errors

Expected Behavior

SVG icons should have valid width and height attributes (either numeric values or omitted entirely).

Actual Behavior

SVG elements are rendered with width="" and height="" which triggers browser parsing errors.

Suggested Fix

In the Lit component that renders wallet icons, ensure width/height are only set when they have valid values:

// Instead of:
width=${this.width}
height=${this.height}

// Use:
width=${this.width || undefined}
height=${this.height || undefined}

Or provide default values when the icon size is not specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions