[Solved] JSON.parse() Error: Unexpected end of JSON input

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: