denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.69k stars 5.34k forks source link

Error running 'deno task build' to create-vite generated Vue + TS app #19418

Open hashrock opened 1 year ago

hashrock commented 1 year ago

We can create vite template with deno run -A npm:create-vite.

So I tested deno task build with these templates:

but only with Vue + TS template I got this error:

% deno task build
Warning Currently only basic package.json `scripts` are supported. Programs like `rimraf` or `cross-env` will not work correctly. This will be fixed in an upcoming release.
Task build vue-tsc && vite build
src/main.ts:3:17 - error TS2307: Cannot find module './App.vue' or its corresponding type declarations.

3 import App from './App.vue'
                  ~~~~~~~~~~~

My environment:

deno 1.34.1 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4
hashrock commented 1 year ago

Additional tests:

hashrock commented 1 year ago

the readme in the Vue + TS template said they use vue-tsc instead of tsc so it might be cause:

https://github.com/vitejs/vite/blob/main/packages/create-vite/template-vue-ts/README.md#type-support-for-vue-imports-in-ts