chrisvxd / story2sketch

Convert Storybook into Sketch symbols 💎
Other
402 stars 32 forks source link

Sketch crashes when inspecting certain layers #108

Open ceciliaschiebel opened 3 years ago

ceciliaschiebel commented 3 years ago

I'm using story2sketch v1.7.1 story2sketch Sketch plugin v4.5.0 Sketch v70.6

This happens when I import a Symbol that originally, in the HTML version, contains an SVG. When I try to inspect that layer (either by cmd + click or clicking in the layers section) Sketch closes. And other team members were able to reproduce too. Any idea what can be causing this?

ceciliaschiebel commented 3 years ago

I found out that I'm able to inspect the layer if the layer's name is not an empty object, i.e. svg group layers should have a name: this is part of my original JSON

...
                 "layers": [
                        {
                          "_class": "group",
                          "do_objectID": "67f10650-0189-404c-b706-6f47a07b06db",
                          "exportOptions": {
                            "_class": "exportOptions",
                            "exportFormats": [],
                            "includedLayerIds": [],
                            "layerOptions": 0,
                            "shouldTrim": false
                          },
                          "isFlippedHorizontal": false,
                          "isFlippedVertical": false,
                          "isLocked": false,
                          "isVisible": true,
                          "layerListExpandedType": 0,
                          "name": {}, <---- this is usually a string in all the other layers
                          "nameIsFixed": false,
                          "resizingConstraint": 63,
                          "resizingType": 0,
                          "rotation": 0,
                          "shouldBreakMaskChain": false,
                          "layers": [
                            {
                              "_class": "svg", <---- here's the svg coordinates
                              ...