Subscribe on changes!

Compiler crashes in some situations when the word "zoom?" is present

avatar
Apr 29th 2022

Version

3.2.33

Reproduction link

sfc.vuejs.org/

Steps to reproduce

The component (see the link) makes the compiler crash

It has something to do with the

  • "zoom" (even it's a comment)
  • "const props ="

What is expected?

The compiler compiles

What is actually happening?

The compiler crashes

avatar
Apr 29th 2022

This will be fine.

Example

<script lang="ts">

</script>

<script setup lang="ts">
interface Props {
  // zoom?
  a?: string;
}
const props = withDefaults(defineProps<Props>(), {
  a: "a",
});
</script>
avatar
Apr 29th 2022

this has nothing to do with zoom thing.

avatar
Apr 29th 2022

@liulinboyi But Volar (VSCode extension) complains about the Props

Moving the interface is recommended by Volar creator: https://github.com/johnsoncodehk/volar/issues/1232#issuecomment-1108042567

avatar
Apr 29th 2022

@edison1105 You're right, it doesn't on the playground. However on my local it does

avatar
May 3rd 2022

I noticed this bug too, is the PR submitted by @edison1105 ready to be merged? I see that all checks passed, is it waiting for a specific approval?

avatar
May 4th 2022

I noticed this bug too, is the PR submitted by @edison1105 ready to be merged? I see that all checks passed, is it waiting for a specific approval?

waiting for Evan's review.

avatar
Sep 12th 2022

Is there any news on solving this error?

avatar
Sep 12th 2022

I have a similar error, created a repository to show it https://github.com/vaban-ru/vue-tsc-reproduction-issue

avatar
Sep 16th 2022

Fixed by naming prop primary something else

avatar
Nov 13th 2022

This problem still seems to exist. Any news on how to solve this?

avatar
Dec 12th 2022

This is a documented feature and not working. I wonder why the fix still not merged, it has been 8 months..

Fixed by naming prop primary something else

Can you give more details? const primary = defineProps<Props>() didn't help. Also tried const primarySomething = ....

avatar
Dec 12th 2022

@azamat-sharapov I think I meant prop itself, not the variable. I think it should be called const props = defineProps<Props>()