dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

Error when rendering uiengine-theme-default/lib/components/navigation/navigation.pug #4

Closed ahx closed 7 years ago

ahx commented 7 years ago

Moin!

When running yarn run uiengine generate, I am getting this error when it tries to render pages or variants:

Page "atoms" could not be generated!

Pug could not render "/Users/ahaller/Desktop/test/node_modules/uiengine-theme-default/lib/templates/page.pug"!

TypeError: /Users/ahaller/Desktop/test/node_modules/uiengine-theme-default/lib/components/navigation/navigation.pug:4
    2|   nav.navigation&attributes(attributes)
    3|     .wrap.wrap--wide
  > 4|       a.navigation__config(href=h.pageLink(navigation['index']))
    5|         | #{config.name} (#{config.version})
    6|       ul.navigation__tree
    7|         +navigationItem('index')

Cannot read property 'path' of undefined

I was starting with a blank project "test". Here is what I did.

mkdir test && cd test && yarn init
…
yarn add -D uiengine uiengine-adapter-pug
yarn run uiengine init
yarn run uiengine component button
yarn run uiengine page atoms
mkdir src/templates &&  touch src/templates/variant-preview.pug
yarn run uiengine generate

💥

Any ideas?

dennisreimann commented 7 years ago

Thanks for your feedback, Andreas!

uiengine init puts page files into ./pages whereas the config in the generated uiengine.yml refers to ./src/pages. Please move ./pages/page.md to ./src/pages/page.md to fix this error.

One more thing that will complain: The generated ./src/components/button/variants/button.pug needs to include ../button.pug at the top.

I'll fix both of these bugs with the upcoming release, thanks for reporting them so thoroughly. Looking forward to meet you in DUS next week!

ahx commented 7 years ago

❤️ See you at BTConf

dennisreimann commented 7 years ago

This issue is fixed with the latest commits and the 0.8.2 release. I also took your nice description and added it as the "fast lane" approach to the getting started docs, see e19788f707f935b6a2a9f103141a91fed603a6c0.

Thanks again for reporting this!