Error returned during JSON.parse() conversion due to conversion characters or other special characters in the data of the converted JSON.stringify().
Solution:
encoding before the JSON.stringify() transformation and decoding the operation when JSON.parse() is solved.
Example:
Jump pass parameter
toEdit() {
this.data.userInfo.faceData = this.data.faceData
let info = encodeURIComponent(JSON.stringify(this.data.userInfo))
wx.navigateTo({
url: '../userEdit/userEdit?info=' + info
})
},
receive data
onLoad(options) {
//decodeURIComponent decoding
let info = JSON.parse(decodeURIComponent(options.info))
this.setData({info:info})
}
Read More:
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- [Solved] ajax Error: Uncaught SyntaxError: Unexpected end of JSON input
- [Solved] TypeError: Converting circular structure to JSON – JSON.stringify
- Json.parse: All Error & How to Solve Them
- Error in created hook: “SyntaxError: Unexpected token u in JSON at position 0
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- [Solved] Error in created hook: “SyntaxError: Unexpected token o in JSON at position 1“
- How to Solve Converting circular structure to JSON‘ Error
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- Such a simple serialization system.text.json.serialization also reports an error?
- error in ./node_modules/@lit/reactive-element/decorators/state.jsModule parse failed: Unexpected
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- ArcGIS API for JavaScript version 4. X updated and the project startup error: Module parse failed: Unexpected token(… …
- [Solved] Prittier format code error: JSON Error in…
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- [Solved] electron Package and Startup Error: Error: ENOENT: no such file or directory, open ‘xxx/manifest.json‘‘
- Special JSON array of special bracket
- [Solved] Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension
- package.json Scripts configuration environment variable distinguishes development environment from production environment
- [Solved] Font End Image Display Error: net::ERR_CONNECTION_RESET 431 (Request Header Fields Too Large)