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

Cannot reference type in template from <script setup> since 0.31.0 #891

Closed
johnsoncodehk opened this issue Jan 23, 2022 · 4 comments · Fixed by #1686
Closed

Cannot reference type in template from <script setup> since 0.31.0 #891

johnsoncodehk opened this issue Jan 23, 2022 · 4 comments · Fixed by #1686
Labels
bug Something isn't working

Comments

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Jan 23, 2022

<template>{{ 1 as Foo /* any */ }}</template>

<script lang="ts" setup>
type Foo = string;
</script>
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Jan 23, 2022
@rogier-stegeman
Copy link

Doesn't work without setup for me either.

@jaulz
Copy link

jaulz commented Apr 6, 2022

Did it really work before? If yes, I assume the issue must be within this commit and we would need to check the respective commits of the updated dependencies as well:
6716c29

@johnsoncodehk
Copy link
Member Author

@jaulz this behavior changed in c5a62ef, actually now this is a design limitation, I still finding a workaround.

@jaulz
Copy link

jaulz commented Apr 7, 2022

@johnsoncodehk thanks for the feedback (and of course your work)! Fingers crossed that there will be a solution soon since I sometimes get an any from scoped slots that I need to cast and that's impossible to fix at the moment as far as I can see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants