Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Incorrect source maps #70

Closed
Djaler opened this issue Apr 29, 2021 · 2 comments
Closed

Incorrect source maps #70

Djaler opened this issue Apr 29, 2021 · 2 comments

Comments

@Djaler
Copy link
Contributor

Djaler commented Apr 29, 2021

For example, I have this SFC:

<template>
    <div>
        <template v-for="item in transformedItems">
            <template v-if="isSubmenu(item)">
                <Menu :key="item.title" :menu="item"/>
            </template>
            <template v-else>
                <MainMenuLink :key="item.title" :item="item"/>
            </template>
        </template>
    </div>
</template>

<script lang="ts">
    import { defineComponent } from '@vue/composition-api';

    import MainMenuLink from '@/components/menu-bar/main-menu-link/MainMenuLink.vue';
    import { isSubmenu } from '@/types/menu';

    import Menu from './Menu.vue';
    import { transformMenuTree } from './transform';

    export default defineComponent({
        name: 'MainMenu',
        components: { MainMenuLink, Menu },
        props: {
            items: {
                type: Array,
                required: true,
            },
        },
        setup(props) {
            const transformedItems = transformMenuTree(props.items, () => {
                debugger;
                return true;
            }, false);

            return {
                transformedItems,
                isSubmenu,
            };
        },
    });
</script>

As you can see, I have a debugger statement on line 34.

If I run this in dev server, I'll get this:
Screenshot_20210429_114401

If I change script from ts to js, I'll get this:
Screenshot_20210429_114504
This isn't correct too, but better then with ts.

@underfin
Copy link
Owner

I fixed location of debugger for ts, but not reproduct for js. Please clear cache and have a try with js, if you also have issue, please provider a reproduction to let me can track it.

@Djaler
Copy link
Contributor Author

Djaler commented Jun 1, 2021

Yeah, now it works for ts as same as for js.
Looks like the +1 LOC issue is caused by vite-plugin-components. Will investigate this, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants