Deno + React + TS + SWC generates a SWC version that doesn't exist
alanko0511 opened this issue · 2 comments
alanko0511 commented
I'm using Deno to create a React.js + TS + SWC Vite project, but in the generated vite.config.mts
file, it wants a SWC version that doesn't exist today. (the latest version is 3.5.0
, but it wants ^4.0.0
)
I have to manually change to ^3.5.0
to get this working.
To produce this:
deno run --allow-read --allow-write --allow-env npm:create-vite-extra@latest
Select a template: › deno-react
Select a variant: › TypeScript + SWC
- Inside the project directory, run
deno task dev
- Then it throws an error:
TypeError: Could not find npm package '@vitejs/plugin-react-swc' matching '^4.0.0'.
My setup:
% deno --version
deno 1.39.2 (release, aarch64-apple-darwin)
v8 12.0.267.8
typescript 5.3.3
alanko0511 commented
I just cloned this repo on my local machine, and I can successfully create a deno + react + ts + swc project with the correct. I also found that the create-vite-extra
downloaded is still 1.1.0
.
alanko0511 commented
Found the issue... I used this tool before, and somehow deno doesn't check and download the latest version, so it uses the version it cached back then.
Specifying the version or not including the version number fixes the issue:
deno run --allow-read --allow-write --allow-env npm:create-vite-extra