taro微信小程序thirdScriptError Maximum call stack size exceeded RangeError: Maximum call stack size excee

taro写微信小程序出错:

thirdScriptError
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377029)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
    at s (http://127.0.0.1:61854/appservice/__dev__/WAService.js:2:1377265)
console.error @ VM26:1
errorReport @ VM42 WAService.js:2
thirdErrorReport @ VM42 WAService.js:2
(anonymous) @ VM42 WAService.js:2
c @ VM42 WAService.js:2
r @ VM42 WAService.js:2
(anonymous) @ VM42 WAService.js:2
value @ VM42 WAService.js:2
(anonymous) @ VM42 WAService.js:2
scriptLoaded @ appservice?t=1584073225343:1124
script.onload @ appservice?t=1584073225343:1136
error (async)
(anonymous) @ VM42 WAService.js:2
(anonymous) @ VM42 WAService.js:2
(anonymous) @ VM42 WAService.js:2
VM42 WAService.js:2 Page "pages/index/index" has not been registered yet.

一步步地剥离新代码,终于定位到地方

export default class Index extends Component {
  state = {
    pic : 'http://www.qqtouxiang.com/d/file/tupian/mx/20170918/jixcmavsyr2dh.jpg'
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }


  config: Config = {
    navigationBarTitleText: '首页'
  }


  render () {
    const myState = this.state
    return (
      <View className='index'>
        <Image src={myState.pic}></Image>
      </View>
    )
  }
}

问题在这句:<Image src={myState.pic}></Image>

改成<Image src={this.state.pic}></Image>

网上也查过,感觉出现这个问题的原因不止这么一种。

作者:帅得不敢出门   https://blog.csdn.net/zmlovelx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值