Figma Code Connect doesn't work.

Đang mở
#311 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
figma, html, typescript

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của figma/code-connect

Tất cả issue của figma/code-connect

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.