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
Object.stringify 循环引用 bug & TypeError: Converting circular structure to JSON #74
Labels
circular-json
circular-json
decycle
decycle
JSON.stringify 数据丢失 bug
JSON.stringify 数据丢失 bug
Object.stringify 循环引用 bug
Object.stringify 循环引用 bug
Comments
xgqfrms
changed the title
TypeError: Converting circular structure to JSON
Object.stringify 循环引用 bug & TypeError: Converting circular structure to JSON
Feb 7, 2020
nuxt.js & TypeError: Converting circular structure to JSONnuxt/nuxt#541 const axios = require('axios');
const CircularJSON = require('circular-json');
axios.get(url, config)
.then((response)=>{
let json = CircularJSON.stringify(response);
res.send(json);
}).catch((error)=>{
console.log(error);
}); |
This comment has been minimized.
This comment has been minimized.
Repository owner
locked and limited conversation to collaborators
Feb 7, 2020
https://www.cnblogs.com/xgqfrms/p/16010654.html https://codepen.io/xgqfrms/pen/PobVdxo?editors=1111 JSON.stringify 数据丢失 bugconst ruleForm = { testKey1: null, testKey2: undefined, // ❌ value 是 undefined 的 key 序列化后会被删除掉 func: function () { console.log('function'); }, // ❌ value 是 function 的 key 序列化后会被删除掉 desc: Symbol('symbol'), // ❌ value 是 symbol 的 key 序列化后会被删除掉 testKey3: NaN, // ✅ value 是 NaN 的 key 序列化后会被转换成 null str: '', bool: false, arr: [], obj: {}, }; |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
circular-json
circular-json
decycle
decycle
JSON.stringify 数据丢失 bug
JSON.stringify 数据丢失 bug
Object.stringify 循环引用 bug
Object.stringify 循环引用 bug
TypeError: Converting circular structure to JSON
貌似是 Object.stringify 这个方法打印的 对象存在循环引用的情况;
The text was updated successfully, but these errors were encountered: