Error running 'deno task build' to create-vite generated Vue + TS app
We can create vite template with deno run -A npm:create-vite.
So I tested deno task build with these templates:
- React + JS
- React + TS
- React + TS + SWC
- Vanilla + JS
- Vanilla + TS
- Vue + JS
- Vue + TS
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
Additional tests:
- Svelte + TS ✅
- Svelte + JS ✅
- Lit + TS ✅
- Lit + JS ✅
- Preact + TS ❌
- Preact + JS ❌
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
deno+vite +preact [plugin:vite:preact-jsx] Cannot find package '@babel/plugin-transform-react-jsx-development' imported from ***
I believe this issue is now fixed as you can generate Vue project with Vite in Deno without a problem.
I'm not sure that this issue was resolved. I believe the issue was around the error when trying to run the deno task build command with the scaffolded out code, not just whether the scaffolding worked fullstop. I've also come across a similar issue myself although I only get the error and not the warning, i.e.:
Task build vue-tsc && vite build
src/main.ts:3:17 - error TS2307: Cannot find module './App.vue' or its corresponding type declarations.
I'm using the latest version of Deno (v2.1.4).
One workaround that I have found is to remove the vue-tsc command from the build task but because vite doesn't do any type checking I'm not sure this is a long term solution. I think this does mean that vue-tsc or vite is at fault. Does that seem correct? Is it more likely to be one than the other (so that I can report it to the correct repo)?