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

Supporting src attribute in SFCs when using vue-tsc #948

Closed
oivvio opened this issue Feb 9, 2022 · 2 comments
Closed

Supporting src attribute in SFCs when using vue-tsc #948

oivvio opened this issue Feb 9, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@oivvio
Copy link

oivvio commented Feb 9, 2022

A SFC looking like this will generate a whole bunch of errors, although it's a perfectly legal way of writing Vue SFCs.

<script lang="ts" src="./RootComponent.ts" />
<template src="./RootComponent.html" />
<style scoped lang="scss" src="./RootComponent.scss" />

Truncated vue-tsc --noEmit ouput.

src/components/RootComponent/RootComponent.vue:2:11 - error TS1005: '>' expected.
                                                                                        
2 <template src="./RootComponent.html" />                                               
            ~~~
                                                                                        
src/components/RootComponent/RootComponent.vue:2:14 - error TS1005: ';' expected.
                                                                                        
2 <template src="./RootComponent.html" />                                               
               ~
                                                                                        
src/components/RootComponent/RootComponent.vue:2:39 - error TS1109: Expression expected.
                                                                                        
2 <template src="./RootComponent.html" />                                               
                                        ~
@oivvio oivvio changed the title Supporting src attribute in SFC Supporting src attribute in SFCs Feb 9, 2022
@oivvio oivvio changed the title Supporting src attribute in SFCs Supporting src attribute in SFCs when using vue-tsc Feb 9, 2022
@johnsoncodehk
Copy link
Member

Thanks for the report! You might want to use <template src="./RootComponent.html"></template> instead of <template src="./RootComponent.html" /> for now.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Feb 12, 2022
@johnsoncodehk
Copy link
Member

I can't reproduce the vue-tsc error in latest version, please let me know if you still have this problem.

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

No branches or pull requests

2 participants