Skip to content

Dev Version Issues

Thanks a lot for your continuous effort to improve vuedoc =D

As you asked me I've tried the dev version now, there are two issues I came across

Mixins

I unfortunately haven't been able to track down the exact cause, but one of my mixins has this issue. The others are fine but I cannot discern what is different that causes it. Fortunately the TestMixin I've used to forward issues to you in it's current state causes it as well.

Code

import Vue from 'vue'

/**
 * @mixin
 */
export function TestMixinFactory(boundValue: number) {
    return Vue.extend({
        methods: {
            /**
             * Testing
             *
             * @public
             */
            myFunction(test: Promise<string>): number {
                let a, b, c = 0
                let d = !(a || b || c)
                return boundValue
            },
        },
    })
}

Error

TypeError: Cannot read property 'errors' of undefined
    at C:\dev\module-laravel-app\node_modules\@vuedoc\md\index.js:6:17
    at new Promise (<anonymous>)
    at C:\dev\module-laravel-app\node_modules\@vuedoc\md\index.js:5:53
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async test (C:\dev\module-laravel-app\build_docs.js:229:9)

To me it sounds as if the parser just didn't return anything, bit I might be wrong on that.

Arrow function issue

Code

<template>
    <div>

    </div>
</template>

<script lang='ts'>
    import {extend, pick} from 'lodash'
    import mixins   from 'vue-typed-mixins'

    const Vue = mixins()
    export default Vue.extend({
        name: "TestComponent",
        methods: {
            test() {
                function pickOpts({sortBy, sortDesc, page, itemsPerPage}) {
                    return {sortBy, sortDesc, page, itemsPerPage}
                }

                const params: any = (({sortBy, sortDesc, page, itemsPerPage}) => ({sortBy, sortDesc, page, itemsPerPage}))(this.options)
                //const params: any = pick(this.options, ['sortBy', 'sortDesc', 'page', 'itemsPerPage'])
                //const params: any = pickOpts(this.options)
                params.search     = this.dSearch
                extend(params, this.fetchParams) // <--- error here I think
            }
        }
    })
</script>

Error

C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\EventParser.js:92
        switch (node.callee.property.name) {
                                     ^

TypeError: Cannot read property 'name' of undefined
    at EventParser.parseCallExpression (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\EventParser.js:92:38)
    at EventParser.parse (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\AbstractParser.js:63:14)
    at EventParser.parse (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\AbstractExpressionParser.js:14:15)
    at EventParser.parseIdentifier (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\AbstractParser.js:125:12)
    at EventParser.parse (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\AbstractParser.js:71:14)
    at EventParser.parse (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\AbstractExpressionParser.js:14:15)
    at C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\EventParser.js:83:51
    at Array.forEach (<anonymous>)
    at EventParser.parseCallExpression (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\EventParser.js:83:24)
    at EventParser.parseExpressionStatement (C:\dev\module-laravel-app\node_modules\@vuedoc\parser\lib\parser\EventParser.js:145:14)
Script node build_docs.js handling the build-docs event returned with error code 1

The error is somehow caused by the assignment of param by the insta-call arrow function. If I replace it with the somewhat (in result) similar call to the lodash function or call to an actual function (commented out above) it works.