figma / code-connect

A tool for connecting your design system components in code with your design system in Figma
MIT License
972 stars 70 forks source link

Figma Connect Failing #214

Open kahlillalji-ah opened 2 days ago

kahlillalji-ah commented 2 days ago

Please provide:

This is the error I'm getting when running swift run -c release --verbose figma-swift

/Users/kahlil/Desktop/swift-design-system/.build/checkouts/code-connect/swiftui/lib/CodeConnectTemplateWriter.swift:227:101: error: binary operator '??' cannot be applied to operands of type '(output: String, changes: [Formatter.Change])?' and 'String'
        let formatted = (try? SwiftFormat.format(code.trimmedDescriptionRemovingReturnStatement())) ?? code.trimmedDescriptionRemovingReturnStatement()
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kahlil/Desktop/swift-design-system/.build/checkouts/code-connect/swiftui/lib/CodeConnectTemplateWriter.swift:249:35: error: cannot infer contextual base in reference to member 'whitespacesAndNewlines'
        ).trimmingCharacters(in: .whitespacesAndNewlines)

I'm doing this because figma connect create returns this

node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v18.18.0
slees-figma commented 4 hours ago

Hey @kahlillalji-ah! Thanks for the detailed report. Would you mind running npx figma connect create --verbose and sharing the output?

I'm not able to repro this error in a swift project on my end, so if the above doesn't surface anything it might be best for you to raise a support ticket so we can investigate in your file further.