Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mobayen opened this issue Apr 29, 2022 · 12 comments · Fixed by #5831
Closed

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

mobayen opened this issue Apr 29, 2022 · 12 comments · Fixed by #5831
Labels
feat: compiler feat: script-setup Related to experimental implementation of RFC #227 🐞 bug Something isn't working

Comments

@mobayen
Copy link

mobayen commented Apr 29, 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

@liulinboyi
Copy link
Member

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>

@edison1105
Copy link
Member

this has nothing to do with zoom thing.

@edison1105 edison1105 added 🐞 bug Something isn't working feat: compiler feat: script-setup Related to experimental implementation of RFC #227 labels Apr 29, 2022
@mobayen
Copy link
Author

mobayen commented Apr 29, 2022

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

Moving the interface is recommended by Volar creator:
vuejs/language-tools#1232 (comment)

@mobayen
Copy link
Author

mobayen commented Apr 29, 2022

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

@theolavaux
Copy link

theolavaux commented May 3, 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?

@edison1105
Copy link
Member

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.

@vaban-ru
Copy link

Is there any news on solving this error?

@vaban-ru
Copy link

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

@PixsaOJ
Copy link

PixsaOJ commented Sep 16, 2022

Fixed by naming prop primary something else

@alperkay
Copy link

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

@azamat-sharapov
Copy link

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 = ....

@PixsaOJ
Copy link

PixsaOJ commented Dec 12, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: compiler feat: script-setup Related to experimental implementation of RFC #227 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants