bem/bem-xjst

runtimeLint fails with TypeError: Converting circular structure to JSON

tadatuta opened this issue · 9 comments

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)

schedule.bemhtml.js.html.zip

// cc @Realetive

What steps to reproduce that error?

bem-xjst version?

Obviously that error from JSON.stringify which is not working with circular structure in JSON.

@miripiruni bem-xjst@8.6.7

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.

qfox commented

Use util.inspect for the justice!

@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.

🎉