Skip to main content
Question

Urgent Support Needed: Manifest & Syntax Errors in Figma Plugin

  • February 28, 2025
  • 0 replies
  • 98 views

Aditi996

I am encountering several errors while running my Figma plugin, which converts websites into editable Figma designs. The plugin fetches website content, processes HTML and CSS, and transforms it into Figma components while preserving styles, layout, and assets. However, I am facing manifest permission issues and syntax errors, which are preventing the plugin from functioning correctly.

here is the project url - https://github.com/aditya-sphereoutsourcing/figma-htmlui

Error Details

  1. Manifest Errors

    • Invalid permission specified: currentPage
    • Invalid value for networkAccess. If you want to allow all domains, please add a "reasoning" field to the networkAccess object.
  2. Syntax Error in Vendor Core File

     

    pgsql

    CopyEdit

    Syntax error on line 52: Unexpected token . parsed.textContent = element.textContent?.trim(); ^

  3. Multiplayer Session Connection Issues

    • The console repeatedly logs [MultiplayerSession] connecting to wss://www.figma.com/api/multiplayer/..., followed by multiple reconnect attempts.

Workflow & Where the Error Occurs

🔄 Backend Process Flow

  1. Initial Request Processing

    • figma.ui.onmessage listens for a message when the user requests a website conversion.
    • The plugin fetches the website's content using fetch(msg.url).
  2. HTML Parsing (src/parsers/htmlParser.ts)

    • Converts the raw HTML into a structured DOM tree.
    • Extracts properties, styles, and attributes.
    • Handles special elements (like images, SVGs).
  3. CSS Processing (src/parsers/cssParser.ts)

    • Extracts CSS rules and computes styles.
    • Resolves shorthand properties and media queries.
  4. Style Conversion (src/utils/styleConverter.ts)

    • Converts CSS properties to Figma-compatible formats.
    • Handles unit conversions (px, rem, em).
  5. Figma Node Creation (src/utils/figmaUtils.ts)

    • Creates corresponding Figma nodes.
    • Applies styles, layout, and constraints.

🛠️ Where the Error Occurs

  • The manifest errors occur when Figma attempts to validate permissions.
  • The syntax error (Unexpected token .) happens in a minified vendor core file, possibly due to unsupported optional chaining (?.).
  • The Multiplayer Session reconnect loop suggests an issue with WebSocket connectivity to Figma’s API.

🛠️ Steps Taken to Resolve

  1. Verified manifest.json to ensure correct permissions for currentPage and networkAccess.
  2. Checked if the optional chaining (?.) is causing compatibility issues with the Figma plugin environment.
  3. Attempted to reconnect manually, but WebSocket disconnections persist.

Could you please provide guidance on resolving these issues? Your help would be greatly appreciated!

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings