Lona / Lona

A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export Lona/examples/material-design/*.component to React Native Code error.

michaeldong opened this issue · comments

commented

When I use node , try export component that in "Lona/examples/material-design".
Error accur. It's say " Cannot destructure property children of 'undefined' or 'null"

➜ Lona git:(master) ✗ node compiler/react/index.js /Users/Dong/Documents/gitHubFork/Lona output
/Users/Dong/Documents/gitHubFork/Lona/examples/material-design/components/Card.component => output/examples/material-design/components/Card.js
/Users/Dong/Documents/gitHubFork/Lona/examples/material-design/components/ListItem.component => output/examples/material-design/components/ListItem.js
(node:40256) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property children of 'undefined' or 'null'.
at getLayers (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/utils/layer.js:5:26)
at getAllLayers (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/utils/layer.js:14:3)
at getAllComponentLayers (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/utils/layer.js:20:10)
at readComponent (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/utils/component.js:33:31)
at convertComponent (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/convert.js:487:21)
at files.filter.forEach (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/index.js:89:22)
at Array.forEach ()
at glob (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/index.js:73:8)
at f (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/once/once.js:25:25)
at Glob. (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/glob/glob.js:151:7)
at emitOne (events.js:116:13)
at Glob.emit (events.js:211:7)
at Glob._finish (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/glob/glob.js:197:8)
at done (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/glob/glob.js:182:14)
at Glob._processGlobStar2 (/Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/glob/glob.js:637:12)
at /Users/Dong/Documents/gitHubFork/Lona/compiler/react/node_modules/glob/glob.js:626:10

commented

This's project has demo that can generate React Native Code?

commented

image
oh, I search there are some test js!!!

Where can I find detail instruction to generate it?
I read your ReadME , this instruction " node index.js workpath output" doubt me.
I can't generate your test js code.
Hope your reply , and help!

thanks for your great Project!

commented

Node version: v8.10.0

commented

Anyone can help me? or update the old ReadMe @dabbott. Hope your reply!

commented

Thanks for your link. But I follow it, It's tell me "Expected field 'rootLayer'" . What am I missing? look forward your lastest ReadMe can help me. Thanks again! @dabbott
image

commented

Oh, I might find The Reason. https://www.npmjs.com/package/bs-json . Your project use bs-json.
my npm ignore bs-json. so I can't parse component's json.
This package has been deprecated . Hope you update your demo.