vite-svg
vite-svg copied to clipboard
Could not find a declaration file for module 'vite-plugin-svg'.
Dev ENV. as follow:
vite.config.js
as follow:
But console in browser still report:
Failed to load module script: The server responded with a non-JavaScript MIME type of "image/svg+xml". Strict MIME type checking is enforced for module scripts per HTML spec.
And eslint
hints:
Could not find a declaration file for module 'vite-plugin-svg'.
Same for the react setup using vite-plugin-react-svg package.
"vite-plugin-react-svg": "^0.2.0",
"react": "^17.0.2",
"typescript": "^4.2.3",
"vite": "^2.1.5"
As a workaround I added a new declaration (.d.ts) file containing "declare module 'vite-plugin-react-svg"