Figma Code Connect doesn't work.

Offen
#311 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
figma, html, typescript

Rechercherichtung

Start by tracing how figma connect publish discovers files from figma.config.json, then inspect the HTML template parser path that handles placeholders in Code Connect mappings. Reproduce the reported monorepo glob and conditional-expression error against the supplied mapping; done means confirming the cause and documenting or fixing discovery and parser behavior for this Vue/HTML setup.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

API question

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

CLI: figma -V → 1.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\...`: **ParserError** — *Expected 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!

Vorherrschende Sprache
TypeScript
Sterne
1.6k
Forks
126
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus figma/code-connect

Alle Issues in figma/code-connect

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.