-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
SFC setup
script does not make imported components available to template with TypeScript + Pug
#4312
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've encountered the similar issue with vue-draggable. I think it's a bug introduced in 3.2.0-beta.5 |
same issue +1 |
Results of preliminary investigation, the AST that lives in the resolveTemplateUsageCheckString function represents a template that has not been processed by |
In my project this problem only occurs in dev mode and work without problem in production build |
I wanted to give my 2 cents on this issue since I was about to create one myself. And like @mbtcg says above is the case for me too, after build everything is working correctly. Error: |
Same issue in new scaffold with Error: [Vue warn]: Invalid vnode type when creating vnode: undefined. |
@cutsin Did you test it with all 3.2.x versions? Downgrading to version 3.2.1 resolved the issue for me, while downgrading to 3.2.0 did not. |
@cutsin @joostdelange if your issue is not related to pug, please open a separate issue with your own reproduction since they are likely not the same problem. It doesn't help if we can't see the code of your components! |
Note: the fix skips the import usage check since with a custom |
Thank you for the fix! 🎉
Because of this, would it be recommended to avoid template pre-processors when using |
Version
3.2.2
Reproduction link
https://github.com/spenserblack/setup-script-typescript-and-pug-issue
Steps to reproduce
<template lang="pug">
and<script setup lang="ts">
What is expected?
Imported component is rendered.
What is actually happening?
Imported component is not rendered, receive warning
This seems to happen specifically when TypeScript and Pug are used together. As you can see in the reproduction, when
<template>
<script setup lang="ts">
, component renders, and when<template lang="pug">
<script setup>
, component renders. Only<template lang="pug">
<script setup lang="ts">
seems to cause the issue.The text was updated successfully, but these errors were encountered: