Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menu: crash on block without content (?) #1320

Closed
qfox opened this issue Jan 31, 2015 · 7 comments
Closed

menu: crash on block without content (?) #1320

qfox opened this issue Jan 31, 2015 · 7 comments
Assignees

Comments

@qfox
Copy link
Member

qfox commented Jan 31, 2015

I have bemjson

{ block : 'menu', content : { block : 'not-menu-item' } }

It doesn't even be rendered and fails with some dirty error in compiled file ;-(

TypeError: Cannot read property '0' of undefined
    at __$b29.iterateItems__$69 (.../index.bemhtml.js:501:46)
    ...

Can we do something with this while we can't build source maps and resolve real filename and real string?

@qfox qfox changed the title menu menu: crash on block without content (?) Jan 31, 2015
@tadatuta
Copy link
Member

@zxqfox I know that's a pain but you may build templates in dev mode and find the very line

@qfox
Copy link
Member Author

qfox commented Jan 31, 2015

@tadatuta I think we should notice in docs that menu supports ONLY objects with content field: https://github.com/bem/bem-components/blob/v2/common.blocks/menu/menu.bemhtml#L18 Or just fix that ;-)

@hcodes
Copy link
Contributor

hcodes commented Feb 4, 2015

/cc @innabelaya
Лучше добавить в документацию.
https://github.com/bem/bem-components/blob/v2/common.blocks/menu/menu.en.md#custom-fields-of-the-block
content Array The array of the menu items.

https://github.com/bem/bem-components/blob/v2/common.blocks/menu/menu.ru.md#custom-fields-of-the-block
content Array Массив пунктов меню.

@qfox
Copy link
Member Author

qfox commented Feb 4, 2015

@hcodes у нас часто видно assertы ругаются. В случае меню с элементами — может тоже добавим?

@hcodes
Copy link
Contributor

hcodes commented Feb 5, 2015

Хорошо, добавлю.

@hcodes hcodes self-assigned this Feb 5, 2015
@hcodes
Copy link
Contributor

hcodes commented Feb 5, 2015

Fixes #1335

@innabelaya
Copy link
Contributor

@hcodes добавила описание #1336

hcodes added a commit that referenced this issue Feb 11, 2015
menu: crash on block without content #1320
@hcodes hcodes closed this as completed Feb 11, 2015
hcodes added a commit that referenced this issue Feb 11, 2015
content field description added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants