Code Connect throws errors in Figma UI after validating with the CLI
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 43/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- html, typescript
- Ambito
- developer-experience, tooling
Direzione di ricerca
Start by reading the Code Connect CLI validation and upload flow for HTML examples, then trace how published examples are interpreted in the Figma UI. Compare the reported figma.slot footer case with the banner's boolean and enum props; the payload does not identify relevant source files or tests. Done means both examples display correctly in Figma or provide actionable errors that explain how to fix the reported cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Code connect seems to throw errors after the CLI has validated it's files and provides no clear directions on what is happening or ways to resolve them. Here's my figma.config.json file.
{
"codeConnect": {
"include": ["src/components/**/*", "src/components/**/*.figma.*"],
"parser": "html",
"importPaths": {
"components/**/*": "components"
},
"paths": {
"components": ["src/components"]
},
"documentUrlSubstitutions": {}
}
}
Both examples were published with the publish command and are web components.
/packages/components/src/components/blz-card/blz-card.figma.ts
/packages/components/src/components/blz-banner/blz-banner.figma.ts
Validating Code Connect files...
All Code Connect files are valid (12873ms)
Uploading to Figma...
uploading to https://api.figma.com/v1/code_connect
Successfully uploaded to Figma, for Web Components:
- Code Connect CLI version:
v1.4.2 - Operating system: MacOS
Card
Here's the *figma.ts version of my card component:
import figma, {html} from '@figma/code-connect/html';
figma.connect(
'https://www.figma.com/design/XXX',
{
props: {
orientation: figma.enum('Orientation', {
Vertical: 'vertical',
Horizontal: 'horizontal',
}),
order: figma.enum('Order', {Default: 'default', Reverse: 'reverse'}),
backplate: figma.enum('↳ Backplate', {True: 'true', False: 'false'}),
media: figma.children('.Card/Media'),
footer: figma.slot('↳ 🧩 Footer'),
},
imports: [
"import '@blizzard/forge-components/components/blz-card/blz-card.js'",
],
example: props =>
html`<blz-card
orientation="${props.orientation}"
order="${props.order}"
backplate="${props.backplate}"
>
<div slot="media">${props.media}</div>
<div slot="footer">${props.footer}</div>
</blz-card>`,
},
);
And the structure in Figma:
For some reason I get an error on Footer despite the names matching:
Banner
In the case of my banner component the entire code connect samples errors.
import figma, {html} from '@figma/code-connect/html';
figma.connect(
'https://www.figma.com/design/XXX',
{
props: {
'auto-gradient': figma.boolean('Auto Gradient'),
height: figma.enum('Height', {"Fixed":"fixed","Flex":"flex"}),
},
imports: ["import '@blizzard/forge-components/components/blz-banner/blz-banner.js'"],
example: props =>
html`<blz-banner auto-gradient="${props['auto-gradient']}" height="${props.height}">
</blz-banner>`,
},
);
- Lingua principale
- TypeScript
- Stelle
- 1.6k
- Fork
- 126
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di figma/code-connect
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
figma/code-connect#419 ·
-
feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
figma/code-connect#403 ·
-
feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
figma/code-connect#414 ·
-
feature request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
figma/code-connect#413 · 1 commento ·
-
feature request
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
figma/code-connect#412 · 1 commento ·
Tutte le issue di figma/code-connect
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel-labs/ui#540 ·
I maintainer di solito rispondono entro 1 giorno
-
accepted ai-dev ai-implementing
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
livesport/homer#218 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Negative values skip k/M abbreviation and medium decimal format on line, stacked-area, and tooltipAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
britecharts/britecharts#1255 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
I maintainer di solito rispondono entro 1 giorno