code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Figma Code Connect doesn't work.

Open Mayank-110679 opened this issue 5 months ago • 0 comments

Title: Code Connect (Vue/HTML, monorepo) — “No Code Connect files found” + template ParserError

CLI: figma -V1.3.5 OS: Windows 11 Home Single Language — 10.0.26100 (Build 26100)

Project: Vue 3 (HTML parser), monorepo (packages/**/src/**)

Config (repo root figma.config.json):

{
  "codeConnect": {
    "parser": "html",
    "include": ["packages/**/src/**/*.figma.ts"],
    "exclude": ["**/dist/**", "**/node_modules/**"],
    "label": "Vue 3"
  }
}

Mapping file path: packages/components/src/figma/default-button.figma.ts

Figma node URL (main component): https://www.figma.com/design/E1fhIWXU1sQRP4ZItKgQu4/GDS-v3.16.1-----Zeta-Hacks-?node-id=27-5765

Mapping (minimal repro):

import figma, { html, text } from '@figma/code-connect/html';

figma.connect("https://www.figma.com/design/E1fhIWXU1sQRP4ZItKgQu4/GDS-v3.16.1-----Zeta-Hacks-?node-id=27-5765", {
  props: {
    text: figma.string("Text"),
    leftIconInstance: figma.instance("Left Icon instance"),
    rightIconInstance: figma.instance("Right Icon instance"),
    iconOnlyInstance: figma.instance("Icon only instance"),
  },
  example: (p) => html`<gds-button>${text(p.text)}</gds-button>`,
  imports: ["import { GdsButton } from '@your-scope/button'"]
});

Steps (CMD):

  1. cd "C:\Users\mayan\OneDrive\Desktop\Figma Code\galaxy-design-system-main"
  2. set FIGMA_ACCESS_TOKEN=figd_xxxxxxxxxxxxxxxxx
  3. npx figma connect publish (Also tried: npx figma connect create "<node-url>" then publish.)

Actual result:

  • Often: “No Code Connect files found …” (even with file present & glob above).
  • When using conditionals inside html\...``: ParserErrorExpected a call expression as a placeholder in the template, got ConditionalExpression. Replaced with text(...)\ calls to avoid conditionals.

Questions:

  1. Are ?:/&& conditionals unsupported inside ${ ... } for HTML templates?
  2. For HTML/Vue projects, should we avoid the interactive wizard and use only create/manual files?
  3. Is my monorepo include glob correct, or is there a better recommended pattern?

Thanks!

Mayank-110679 avatar Sep 09 '25 07:09 Mayank-110679