you have to change generate command like this
"scripts": { "build": "tsc -b && vite build", "lint": "eslint .", "generate": "npx @svgr/cli --out-dir ./src/components --typescript -- ./src/assets", }
check documentation here