Skip to content

Typescript support inside .vue file? #10

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

Closed
voxsoftware opened this issue Jan 4, 2022 · 1 comment
Closed

Typescript support inside .vue file? #10

voxsoftware opened this issue Jan 4, 2022 · 1 comment

Comments

@voxsoftware
Copy link

How get typescript support inside .vue file?

Example, something like this:

<script lang="ts" type="application/typescript">
	import axios from 'axios'
	import {program} from '../app'

	class Component{
		name = "Editor"
		vars: any = {}
		data: any 
		video: HTMLVideoElement
		file: File 
       ....
</script>
✘ [ERROR] Expected ";" but found ":"

    src/components/Editor.vue:235:5:
      235 │   vars: any = {}
          │       ^
          ╵       ;

1 warning and 1 error
/data/projects/Kodhe/videodiff-editor/ui/node_modules/esbuild/lib/main.js:1557
  let error = new Error(`${text}${summary}`);
@apeschar
Copy link
Owner

apeschar commented Jan 4, 2022

This was not yet supported because we were waiting for a PR to merge in a dependency (vuejs/vue-component-compiler#122). Since that doesn't seem to be happening, I've found another way.

Try upgrading to esbuild-vue version 1.1.0 (just released). It should work.

@apeschar apeschar closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants