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

Vue support #35

Open
rzane opened this issue Mar 29, 2018 · 2 comments
Open

Vue support #35

rzane opened this issue Mar 29, 2018 · 2 comments

Comments

@rzane
Copy link

rzane commented Mar 29, 2018

Official Vue support was added to parcel today. I was hoping that maybe I could use this plugin with a Vue SFC, but that doesn't appear to work as expected.

Here's a repro:

https://gist.github.com/rzane/f7201b93df6d5d2d49269becf53f9f00

Here's the error that gets thrown:

$ yarn parcel App.vue
Server running at http://localhost:1234
✨  Built in 845ms.
Unhandled promise rejection: Error: Error: Error: Could not find file: '/Users/rzane/Workspace/repro/App.vue'.
    at getValidSourceFile (/Users/rzane/Workspace/repro/node_modules/typescript/lib/typescript.js:103059:23)
    at Object.getSemanticDiagnostics (/Users/rzane/Workspace/repro/node_modules/typescript/lib/typescript.js:103238:36)
    at LanguageService.check (/Users/rzane/Workspace/repro/node_modules/parcel-plugin-typescript/build/backend/service/index.js:16:24)
    at Object.<anonymous> (/Users/rzane/Workspace/repro/node_modules/parcel-plugin-typescript/build/backend/worker/launcher.js:34:28)

Would it be possible to support this?

@fathyb
Copy link
Owner

fathyb commented May 5, 2018

The only technical problem I see with Vue.js is type-checking, is there any project in the wild using Vue SFCs with TypeScript and type-checking? It could be pretty hard to implement the Vue parser into TypeScript file host.

If you don't want type-checking you can use transpileOnly to still keep features like path renaming.

@danielegarciav
Copy link

The only technical problem I see with Vue.js is type-checking, is there any project in the wild using Vue SFCs with TypeScript and type-checking?

Yes there are. I have a couple projects using Vue SFCs with TypeScript + types shared across all projects. VS Code is able to catch TypeScript errors in .vue files through Vetur, but Parcel will happily build the project without any errors or warnings.

I can't just use tsc --noEmit since it doesn't read .vue files. Is there any chance Vue SFCs could get any support?

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

3 participants