收藏
回答

anchorRelatedText截断emoji有问题? 导致urlencode报错

WAServiceMainContext.js?t=wechat&s=1699427586612&v=2.25.4:1 URIError: URI malformed
    at encodeURIComponent ()
    at Array.map ()
    at ie._reportShowPage (WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1)
    at WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1
    at ie._checkDeferred (WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1)
    at ie.setReadyTime (WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1)
    at Uo.l.__callPageLifeTime__ (WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1)
    at WASubContext.js?t=wechat&s=1699427586612&v=2.25.4:1
    at r.

报错内容如上, 数据如下(这里的数据anchorRelatedText是在工具里copy的, 不对, 麻烦你们自己写个emoji, 并且正好是要求的最后一位)

anchorRelatedText: "严选好房多房单福田龙岗南山南头皇岗莲花严选  长城盛世家园二期5室2厅㆐290平㆐东北“看看今天”1006万 3.47万/平严选  时代都会2室1厅㆐120平㆐北“srterthrt”1236万 10.3万/平严选  三龙花园3室2厅㆐152平㆐南“兔子�"
anchorTargetText: "查看全部福田好房"
apptype: 1000
clickTimestamp: 1699433763796
costtime: 38
event_id: 1
hostAppId: ""
isentrance: 0
networktype: "wifi"
pagepath: "pages/taro/pages/team-store-house-list/index.html"
pagetype: 2
prescene: undefined
prescene_note: ""
publicLibVersion: "2.24.5"
query: "areaInfo=%257B%2522key%2522%253A%2522440304%2522%252C%2522items%2522%253A%255B%257B%2522key%2522%253A%2522440304%2522%252C%2522name%2522%253A%2522%25E7%25A6%258F%25E7%2594%25B0%2522%257D%255D%257D&from=home&from_city_code=440300&from_team_id=5ef2bc8673d46b21818d9b7f&type=sell"
referpagepath: "pages/team-store-home/index.html"
reportTime: 1699433763834
scene: 1001
scene_note: ""
sessionid: undefined
shortLink: ""
startCostTime: 0
startType: 0
staytime: 0
targetAction: 0
targetPagePath: ""
usedstate: undefined



这里的anchorRelatedText看起来有位数要求, 而最后一位正好是emoji时, 截断没有处理好, 导致后面内部的encodeURIComponent报错


最后一次编辑于  2023-11-08
回答关注问题邀请回答
收藏

1 个回答

  • DXP
    DXP
    2023-12-20

    +1 遇到相同问题,点击元素—>跳转页面的时候。会记录元素的内容,内容如果过长且包含emoji会有可能截断,在2_reportShowPage(e)函数中,导致encodeURIComponent报错,影响后续渲染;

    2023-12-20
    有用
    回复
登录 后发表内容