mathieudutour / git-sketch-plugin

:gem::octocat: A Git client generating pretty diffs built right into Sketch.
https://mathieudutour.github.io/git-sketch-plugin
MIT License
2.45k stars 126 forks source link

Error trying to export PNGs #228

Open jasonkylefrank opened 4 years ago

jasonkylefrank commented 4 years ago

How did it happen?

Try to export PNG images for the artboards.

I'm getting this error on both a pre-existing file and a new, simple file. No PNGs get exported as a result of the error.

I've tried uninstalling all instances of Git.sketchplugin from my machine and starting over with a fresh new download of the plugin. Getting the same error.

On a larger file that I tried the export process on, the beach-ball cursor hung indefinitely. During a normal export process (which doesn't happen now), the cursor turns into the beach-ball for a couple minutes but then completes the export.

Version info

Sketch version: 64 Git-Sketch-Plugin version: 0.12.0 (the new release as of 5 days ago).

Error log

JSON Parse error: Unrecognized token ''

{
    "line": 1,
    "column": 32249,
    "sourceURL": "/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js"
}

parse@[native code]
v@/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js:1:32249
/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js:1:34592
/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js:1:34545
/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js:1:34578
__skpm_run@/Users/jasonfrank/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Git.sketchplugin/Contents/Sketch/__commands_Export.js:1:35021
__skpm_run@[native code]
mathieudutour commented 4 years ago

could you share the file?

jasonkylefrank commented 4 years ago

@mathieudutour The export process fails on every file on my machine and on my colleague's machine (the process either bombs with the same error or the beach-ball hangs indefinitely). I could share a file but all it is a brand new Sketch file with one artboard with a simple rectangle in it. That's it. And again, it happens on every single file. So I'm not sure that there's anything file-specific or even machine-specific going on here.

If you want that one-artboard file, I attached it (I had to change its extension to .txt b/c GitHub won't allow attaching .sketch files). But again, the issue is not file-specific or machine-specific.

Thanks for your help. :-)

Test.txt

pizzaeater commented 4 years ago

For me the same, the beach-ball hangs indefinitely with the latest update. I need to downgrade until it's fixed :(

mathieudutour commented 4 years ago

could you try running

/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool list artboards "/PATH/TO/YOUR/FILE.sketch" --include-symbols=YES

? For some reason it seems that the output isn't a JSON object

pizzaeater commented 4 years ago

could you try running

/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool list artboards "/PATH/TO/YOUR/FILE.sketch" --include-symbols=YES

? For some reason it seems that the output isn't a JSON object

Hi, it prints a big JSON with 'pages' etc.

mathieudutour commented 4 years ago

right but I think you have a different issue than the OP: JSON Parse error: Unrecognized token '�'

jasonkylefrank commented 4 years ago

@mathieudutour When I ran that command on that simple test file it returned this JSON:

{
  "pages" : [
    {
      "id" : "3752D9A8-72F0-44E4-9BF9-1A66D540054C",
      "name" : "Page 1",
      "bounds" : "654.000000,199.000000,360.000000,720.000000",
      "artboards" : [
        {
          "id" : "E8AEFEB1-B022-4468-836F-327EADE80184",
          "name" : "Test 2",
          "rect" : {
            "y" : 199,
            "x" : 654,
            "width" : 360,
            "height" : 720
          },
          "trimmed" : {
            "y" : 199,
            "x" : 654,
            "width" : 360,
            "height" : 720
          }
        }
      ]
    }
  ]
}

The same error is occurring (even with the newest v0.12.1). Thanks for working on it. :-)