Export Lona/examples/material-design/*.component to React Native Code error.
michaeldong opened this issue · comments
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
This's project has demo that can generate React Native Code?
Node version: v8.10.0
@michaeldong yeah, the readme needs updating. Check out https://github.com/airbnb/Lona/tree/master/compiler/core
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
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.