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

Compose parse syntax error

Open HaleyWardo opened this issue 1 year ago • 3 comments

  • Code Connect CLI version: 1.0.0
  • Operating system: macOS Ventura: Version 13.4
  • Code Connect file: Private

When running create and publish, we are getting this error:

SyntaxError: Unexpected token 'S', StartParam"... is not valid JSON.

It it erroring on this line.

FWIW, when running the create command, it does generate the file but it still produces that error. However, when running the publish command, it does not publish the component.

HaleyWardo avatar Jul 29 '24 14:07 HaleyWardo

Hi @HaleyWardo , can you share your Code Connect file/code with Figma support in order for us to investigate further please.

rrabherufigma avatar Jul 30 '24 10:07 rrabherufigma

@rrabherufigma Hey, I'M facing a similar issue when running the publish command and also when running the parse command. Here is the output:

Command: figma connect parse

Config file found, parsing [...] using specified include globs
undefined:1
configuration ':app:androidApis'
^

SyntaxError: Unexpected token 'c', "configurat"... is not valid JSON
    at JSON.parse (<anonymous>)
    at ChildProcess.<anonymous> (/Users/fet/.nvm/versions/node/v20.2.0/lib/node_modules/@figma/code-connect/dist/connect/parser_executables.js:101:34)
    at ChildProcess.emit (node:events:511:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

Node.js v20.2.0

It seems some Gradle build output is in place of the expected JSON. Also, I have some custom output in the Gradle build which was also present in the error message initially, but I removed this output in order to test Code Connect.

fixilein avatar Sep 17 '24 11:09 fixilein

Hey @fixilein, we've had a report of a somewhat similar issue from another user. We think it's related to something in your build.gradle adding extra output to the console, though we're still investigating. We'll follow up when we have something for you to try here, apologies for the issues!

tomduncalf-figma avatar Sep 18 '24 10:09 tomduncalf-figma