runtimeLint fails with TypeError: Converting circular structure to JSON
tadatuta opened this issue · 9 comments
tadatuta commented
BEMHTML error TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at /Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:3200:36
at Array.forEach (native)
at /Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:3192:39
at Array.forEach (native)
at checkMixes (/Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:3186:11)
at ContextChild.<anonymous> (/Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:3369:7)
at Match.tryCatch (/Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:1329:15)
at Match.exec (/Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:1386:16)
at BEMHTML.renderMix (/Users/realetive/_dev/bem-express/bundles/desktop.bundles/schedule/schedule.bemhtml.js:328:38)
// cc @Realetive
miripiruni commented
What steps to reproduce that error?
miripiruni commented
bem-xjst version?
miripiruni commented
Obviously that error from JSON.stringify
which is not working with circular structure in JSON.
Realetive commented
@miripiruni bem-xjst@8.6.7
Realetive commented
Obviously that error from JSON.stringify which is not working with circular structure in JSON.
How can I exclude to use it in the future? Because I have not this problem while runtimeLint
was disabled.
tadatuta commented
@miripiruni looks like it's in https://github.com/bem/bem-xjst/blob/master/runtime-lint/index.js#L68 (and bellow)
qfox commented
Use util.inspect
for the justice!
miripiruni commented
@zxqfox we can not use util.inspect
because of different execution environment for bem-xjst (node.js and browsers). I would suggest a custom stringify function.
Realetive commented