keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.63k stars 2.21k forks source link

Saving a given document gives Converting circular structure to JSON #1882

Closed jacargentina closed 8 years ago

jacargentina commented 8 years ago

Somebody can help? I'm using latest master (v0.4) from today. I'm editing a document, and hiting Save, then i get:

POST /keystone/docs/560951e127b314d04fe27bb2 302 72.349 ms
/home/javiercastro/javascript/keystone/node_modules/jade/lib/runtime.js:240
  throw err;
  ^

TypeError: /home/javiercastro/javascript/keystone/lib/core/../../admin/server/templates/item.jade:27
    25|             Keystone.list = Keystone.lists[!{JSON.stringify(list.key)}];
    26|             Keystone.wysiwyg = { options: !{JSON.stringify(wysiwygOptions)} };
  > 27|             Keystone.itemId = '!{item.id}';
    28|         script(src='/keystone/js/packages.js')
    29|         script(src='/keystone/js/fields.js')
    30|         script(src='/keystone/js/item.js')

Converting circular structure to JSON
    at Object.stringify (native)
    at eval (eval at <anonymous> (/home/javiercastro/javascript/keystone/node_modules/jade/lib/index.js:218:8), <anonymous>:525:54)
    at eval (eval at <anonymous> (/home/javiercastro/javascript/keystone/node_modules/jade/lib/index.js:218:8), <anonymous>:801:22)
    at res (/home/javiercastro/javascript/keystone/node_modules/jade/lib/index.js:219:38)
    at render (/home/javiercastro/javascript/keystone/lib/core/render.js:108:11)
    at /home/javiercastro/javascript/keystone/admin/server/routes/item.js:62:14
    at /home/javiercastro/javascript/keystone/node_modules/async/lib/async.js:52:16
    at done (/home/javiercastro/javascript/keystone/node_modules/async/lib/async.js:246:17)
    at /home/javiercastro/javascript/keystone/node_modules/async/lib/async.js:44:16
    at /home/javiercastro/javascript/keystone/admin/server/routes/item.js:49:6
    at /home/javiercastro/javascript/keystone/lib/list/paginate.js:78:5
    at Query.<anonymous> (/home/javiercastro/javascript/keystone/node_modules/mongoose/lib/query.js:2139:28)
    at /home/javiercastro/javascript/keystone/node_modules/kareem/index.js:177:19
    at /home/javiercastro/javascript/keystone/node_modules/kareem/index.js:109:16
    at doNTCallback0 (node.js:430:9)
    at process._tickCallback (node.js:359:13)

How can i debug it, or any advice on where to look for the reason?

jacargentina commented 8 years ago

Related to PR #1876. Fixed now.