Skip to content

[3.0.0b3] Typescript Parser Error

Summary

Not sure what exactly causes it since the line in the error is certainly off.

Steps to reproduce

<template>
    <div>

    </div>
</template>

<script lang='ts'>
    import mixins             from 'vue-typed-mixins'
    import {ComponentOptions} from 'vue'

    const Vue = mixins()
    export default Vue.extend({
        name: "TestComponent",
        components: {
            "css-style": <ComponentOptions<any>>{
                render: function (createElement) {
                    return createElement("style", (this as any).$slots.default)
                },
            } as any,
        },
    })
</script>

What is the current bug behavior?

Generating for TestComponent
Error: Unexpected token, expected "}" (10:18)
    at C:\dev\module-laravel-app\node_modules\@vuedoc\md\index.js:15:12
    at new Promise (<anonymous>)
    at C:\dev\module-laravel-app\node_modules\@vuedoc\md\index.js:13:53
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async test (C:\dev\module-laravel-app\build_docs.js:248:9)

What is the expected correct behavior? No error

Several of my components and mixins show this error but I haven't been able to find out exactly what causes it. This is the minimal example I could come up with, it's something in the components section that causes it. My best guess is that it's the {} syntax, but I'm not sure.