2***@qq.com
2***@qq.com
  • 发布:2022-03-18 10:25
  • 更新:2022-06-08 15:36
  • 阅读:536

【报Bug】打包app,在IOS9系统下,APP子组件data和PROPS随机性出现undefined

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOS Big Sur 版本11.16

HBuilderX类型: 正式

HBuilderX版本号: 3.3.13

手机系统: iOS

手机系统版本号: iOS 9.2

手机厂商: 苹果

手机机型: iphone 5s

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

示例代码:

页面代码:

<template>  
    <view class="container">  
        <swiper>  
            <swiper-item v-for="(item,index) of list" :key="index">  
                item{{item}}  
                <testIf :item="item + 'testIf'"></testIf>  
            </swiper-item>  
        </swiper>  
        <uni-load-more :status="'more'"></uni-load-more>  
    </view>  
</template>  

<script>  
    import testIf from './testIf'  
    export default {  
        data() {  
            return {  
                href: 'https://uniapp.dcloud.io/component/README?id=uniui',  
                isShowIf: 0,  
                list: []  
            }  
        },  
        components: {  
            testIf  
        },  
        onLoad() {  
            let that = this  
            uni.request({  
                url: 'https://************',  
                success(data) {  
                    console.log('data', data)  
                    that.list = [4, 5, 6]  
                    console.log('list', that.list)  
                }  
            })  
        },  
        methods: {  

        }  
    }  
</script>  

组件代码:

<template>  
    <view>  
        <view>item{{item}}aaaaa{{aaaaa}}</view>  
    </view>  
</template>  

<script>  
    export default {  
        props: {  
            item: {  
                type: String,  
                default: ''  
            }  
        },  
        data() {  
            return {  
                aaaaa: '332'  
            }  
        }  
    }  
</script>  

<style>  
</style>  

操作步骤:

页面请求数据,参入子组件

预期结果:

子组件正常显示页面传入参数

实际结果:

1、子组件取到页面传入的props参数,显示undefined
2、取data里面的数据,也是显示undefined

bug描述:

  1. 页面上请求数据后,将数据传入子组件,APP运行在ios9系统下,子组件data和PROPS随机性出现undefined,控制台报错:

cid unmatched [object Object]
10:26:06.922 TypeError: Invalid attempt to destructure non-iterable instance.
10:26:06.943 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
10:26:06.965 cid unmatched [object Object]
10:26:06.985 TypeError: Invalid attempt to destructure non-iterable instance.
10:26:07.007 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
10:26:07.031 cid unmatched [object Object]
10:26:07.053 TypeError: Invalid attempt to destructure non-iterable instance.
10:26:07.074 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.

2、代码demo如附件

3、离线打包和直接运行都出现一样的问题

4、小程序和h5正常

2022-03-18 10:25 负责人:DCloud_UNI_GSQ 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

目前仅有iOS9.3.5的设备,反复测试未复现。

尚未确定是测试机型版本高于你的版本导致还是操作步骤未掌握导致。

  • 2***@qq.com (作者)

    你好,我这边直接用hbuildx直接运行到系统为9.2版本的真机上,多执行几次回退,进页面,就会偶发性出现这个问题

    2022-03-30 11:17

  • 2***@qq.com (作者)

    你好。问题是否能够排查,由于无法取到变量值,会导致很多组件功能偶发性出问题,影响较大

    2022-04-01 15:56

  • DCloud_UNI_GSQ

    回复 2***@qq.com: 目前仅有iOS9.3.5的设备,反复切换页面几十次,未复现。

    2022-04-01 16:56

2***@qq.com

2***@qq.com

小程序,H5问题少,编译app,问题较多:
cid unmatched [object Object] at view.umd.min.js:1
TypeError: Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1
小程序正常显示

要回复问题请先登录注册