Skip to content

Instantly share code, notes, and snippets.

@ResuBaka
Last active August 6, 2019 06:03
Show Gist options
  • Save ResuBaka/b922715652e51f8f2047f7e629b4937d to your computer and use it in GitHub Desktop.
Save ResuBaka/b922715652e51f8f2047f7e629b4937d to your computer and use it in GitHub Desktop.
TypeError: Converting circular structure to JSON Vue-storefront debugging code
  TypeError: Converting circular structure to JSON
     at JSON.stringify (<anonymous>)
     at serialize /node_modules/serialize-javascript/index.js:121:20)
     at ho.serialize /node_modules/vue-server-renderer/build.prod.js:1:73290)
     at ho.renderState /node_modules/vue-server-renderer/build.prod.js:1:75911)
     at Object.eval [as default] (eval at <anonymous> /node_modules/lodash.template/index.js:1089:12), <anonymous>:24:11)
     at renderer.renderToString.then.output /core/scripts/server.js:181:59)    

node_modules/serialize-javascript/index.js:127

// Creates a JSON string representation of the value.
// NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.
if (options.isJSON && !options.space) {
  let file = `/tmp/bug${Date.now()}.js`
  require('fs').writeFile(file, require('util').inspect(obj, { depth: 5}) , function (err) {
    if (err) throw err;
    console.log('Saved!');
  });
  console.log(file)
    str = JSON.stringify(obj);
} else {
    str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment