design-ops / sketch-to-swiftUI

23 stars 5 forks source link

Cannot read property '_ref' of undefined #41

Closed otusweb closed 3 years ago

otusweb commented 3 years ago

Got this error when running on my sketch file:

🎨 Processed 0 Layer Styles!

Failed to extract TypeError: Cannot read property '_ref' of undefined
    at performCopy (/Users/otusweb/Projects/sketch-to-swiftUI/lib/copyFonts.js:53:73)
    at async copyFonts (/Users/otusweb/Projects/sketch-to-swiftUI/lib/copyFonts.js:39:18)
    at async processTextStyles (/Users/otusweb/Projects/sketch-to-swiftUI/lib/processTextStyles.js:64:17)
    at async processSketchFile (/Users/otusweb/Projects/sketch-to-swiftUI/lib/processSketch.js:25:22)
kerrmarin commented 3 years ago

Hey @otusweb would you mind sharing a sketch file that reproduces this problem?

kerrmarin commented 3 years ago

(sorry for the super late reply, I don't think I got a notification for this)

FWMatt commented 3 years ago

I have the same issue @otusweb

Sketch file here:- https://futureworkshops.box.com/s/s9841ohnsqmljacc5yg52q1oe1azso7v

kerrmarin commented 3 years ago

Thanks @FWMatt for the sketch file. I'm taking a look at this next week.

kerrmarin commented 3 years ago

Hey, the reason you were getting that error is because the font wasn't embedded in your sketch document.

There was also a bug that prevented us from attempting to retrieve the font as a system font, so I've made and merged a patch for that. You should be able to pull from master to get the latest changes and run:

 npm run convert -- /path/to/my/sketch/file.sketch --svg

To export your theme.