regenerator icon indicating copy to clipboard operation
regenerator copied to clipboard

TypeError: Function(...) is not a function

Open wangkangquan opened this issue 4 years ago • 1 comments

  • version: 0.13.3
  • condition:use regenerator-runtime in uni-app project

my code

<template>
    <div class="demo"></div>
</template>
<script>
export default {
    components: { },
    data() {
        return {};
    },
    mounted() {
        this.test1();
    },
    methods: {
        async test1() {
            const msg = await this.test2();
            console.log('============ ', msg);
        },
        test2() {
            return new Promise(resolve => {
                setTimeout(() => {
                    resolve('hello');
                }, 2000);
            });
        }
    }
};
</script>
<style lang="scss" scoped>
</style>

raise an error that says

TypeError: Function(...) is not a function
    at Object.cf (http://127.0.0.1:64467/index.worker.js?t=1574069625913:3851:46)
    at c (http://127.0.0.1:64467/index.worker.js?t=1574069625913:2020:91)
    at Object.a34a (http://127.0.0.1:64467/index.worker.js?t=1574069625913:3854:17)
    at c (http://127.0.0.1:64467/index.worker.js?t=1574069625913:2020:91)
    at Object.b2f (http://127.0.0.1:64467/index.worker.js?t=1574069625913:4619:89)
    at c (http://127.0.0.1:64467/index.worker.js?t=1574069625913:2020:91)
    at Module._ (http://127.0.0.1:64467/index.worker.js?t=1574069625913:4679:20)
    at c (http://127.0.0.1:64467/index.worker.js?t=1574069625913:2020:91)
    at Module.e (http://127.0.0.1:64467/index.worker.js?t=1574069625913:4669:13)
    at c (http://127.0.0.1:64467/index.worker.js?t=1574069625913:2020:91)

I've found that if change the version of "0.12.1" , this program is functioning well now

wangkangquan avatar Nov 18 '19 10:11 wangkangquan

Duplicate of #378 ?

bwindels avatar Feb 04 '21 10:02 bwindels