Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save antonio-ivanovski/e4bb90396897353aa087748bfcd6423d to your computer and use it in GitHub Desktop.
Save antonio-ivanovski/e4bb90396897353aa087748bfcd6423d to your computer and use it in GitHub Desktop.
Vite Cannot find module './assets/react.svg' error solution
If you are getting `Cannot find module './assets/react.svg' or its corresponding type declarations.ts(2307)` or `Cannot find module '/vite.svg' or its corresponding type declarations.ts(2307)` or similar error when getting started with Vite React TS template, you need to add inside the `src` directory the `vite-env.d.ts` with contents
```ts
/// <reference types="vite/client" />
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment