收藏
回答

基础库版本1.6.4 '__route__' of undefined

问题模块
API和组件


在未使用自定义组件时,可以正常显示,现在加入了一个自定义组件,报下面的错误



WAService.js:12 Uncaught (in promise) TypeError: Cannot read property '__route__' of undefined

    at WAService.js:12

    at EmitterService.js? [sm]:47

    at Array.forEach (<anonymous>)

    at EmitterService.emit (EmitterService.js? [sm]:46)

    at Object.publishWorkContext (WorkContextService.js? [sm]:49)

    at Object.<anonymous> (CheckoutService.js? [sm]:65)

    at r (tslib.js? [sm]:1)

    at Object.next (tslib.js? [sm]:1)

    at _ (tslib.js? [sm]:1)

    at <anonymous>

(anonymous) @ WAService.js:12

(anonymous) @ EmitterService.js? [sm]:47

EmitterService.emit @ EmitterService.js? [sm]:46

publishWorkContext @ WorkContextService.js? [sm]:49

(anonymous) @ CheckoutService.js? [sm]:65

r @ tslib.js? [sm]:1

(anonymous) @ tslib.js? [sm]:1

_ @ tslib.js? [sm]:1

Promise rejected (async)

i @ tslib.js? [sm]:1

(anonymous) @ tslib.js? [sm]:1

__awaiter @ tslib.js? [sm]:1

BillingAddressPage.onSelectAddress @ billingAddressPage.js? [sm]:88

(anonymous) @ WAService.js:13

a @ WAService.js:13

K @ WAService.js:13

(anonymous) @ WAService.js:13

(anonymous) @ WAService.js:13

(anonymous) @ WAService.js:6

e.(anonymous function) @ WAService.js:3

d @ appservice:1728

g.registerCallback @ appservice:1728

k.forEach @ appservice:1728

d @ appservice:1728

h.onmessage @ appservice:1728


最后一次编辑于  2017-11-03  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏投诉关注问题回答

7 个回答

  • Six006
    Six006
    2017-11-03

    查了一下在子组件使用,

    wx.navigateTo({

        url: '另一个Page页面'

    });

    就报这样的错误,不知道为什么

    2017-11-03
    赞同
    回复
  • Six006
    Six006
    2017-11-03

    如何使用wx.navigateTo报错,用wx.redirectTo不报错



    Component({

    properties: {

    model: {

    type: Object,

    value: {}

    },

    },

    data: {},

    methods: {

    onChooseBillingAddress(e) {

    let url = PageConfig.checkoutBillingAddressPage.url;

    // PageUtil.navigateTo(url);


    // 报错

    wx.navigateTo({

    url

    });


    // 不报错

    wx.redirectTo({

    url

    });

    }

    }

    });



    2017-11-03
    赞同
    回复
  • LastLeaf
    LastLeaf
    2017-11-03

    你好,我没能根据你提供的代码复现问题。麻烦提供更完整的代码以方便排查。

    2017-11-03
    赞同
    回复
  • Six006
    Six006
    2017-11-03

    好的,我周末整理一下

    2017-11-03
    赞同
    回复
  • Six006
    Six006
    2017-11-03

    问题解决了:需要加个bind(this),不知道是不是基础库改了的原因,以前是不需要加xxx.bind(this),


    this.handleCheckoutChanged.bind(this)




    2017-11-03
    赞同
    回复
  • LastLeaf
    LastLeaf
    2017-11-03

    请问是什么方法要加bind(this)呢?

    2017-11-03
    赞同
    回复
  • 阿訇的蒲
    阿訇的蒲
    2018-01-12

    谢谢,我也遇到这个问题了,用你的方法解决了

    2018-01-12
    赞同
    回复