Does this work with html storybooks?
hipstersmoothie opened this issue · 5 comments
I get the following error trying to use my html storybook
cessing 1 stories...
Error: Evaluation failed: TypeError: node.getBoundingClientRect is not a function
at nodeTreeToSketchGroup (/Users/alisowski/Documents/intuit-components/node_modules/story2sketch/lib/server/../browser/page2layers.bundle.js:1693:18)
at Object.getSymbol (/Users/alisowski/Documents/intuit-components/node_modules/story2sketch/lib/server/../browser/page2layers.bundle.js:2066:103)
at puppeteer_evaluation_script:4:12
at ExecutionContext.evaluateHandle (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/ExecutionContext.js:90:15)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at ExecutionContext. (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/helper.js:144:27)
at ExecutionContext.evaluate (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/ExecutionContext.js:58:31)
at ExecutionContext. (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/helper.js:145:23)
at Frame.evaluate (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/FrameManager.js:439:20)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/helper.js:144:27)
at Page.evaluate (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/Page.js:736:43)
at Page. (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/helper.js:145:23)
at Story2sketch._callee5$ (/Users/alisowski/Documents/intuit-components/node_modules/story2sketch/lib/server/Story2sketch.js:532:29)
at tryCatch (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/alisowski/Documents/intuit-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/alisowski/Documents/intuit-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at
-- ASYNC --
at Page. (/Users/alisowski/Documents/intuit-components/node_modules/puppeteer/lib/helper.js:144:27)
at Story2sketch._callee5$ (/Users/alisowski/Documents/intuit-components/node_modules/story2sketch/lib/server/Story2sketch.js:532:29)
at tryCatch (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (/Users/alisowski/Documents/intuit-components/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/Users/alisowski/Documents/intuit-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/alisowski/Documents/intuit-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Success! 0 stories written to /Users/alisowski/Documents/intuit-components/out/ttds.asketch.json
✨ Done in 2.94s.
@hipstersmoothie I'll look into this - I haven't tested it with HTML only, but it should work.
If this is referring to creating a Sketch file from a built Storybook, as of Storybook v6 file urls do not work (see storybookjs/storybook#7215 (comment)). You must use npx http-server storybook-static/
to run a built storybook.
@itsderek23 I believe this issue was before Storybook 6 existed.
Are you successfully using story2sketch on an HTML-only storybook?
@itsderek23 I believe this issue was before Storybook 6 existed.
Ah.
Are you successfully using story2sketch on an HTML-only storybook?
Yes if using npx http-server storybook-static/
. No if using --input storybook-static
. I've only tested against Storybook 6.
Great, thanks for clarifying!