vite-svg icon indicating copy to clipboard operation
vite-svg copied to clipboard

Could not find a declaration file for module 'vite-plugin-svg'.

Open carmel opened this issue 4 years ago • 1 comments

Dev ENV. as follow:

image

vite.config.js as follow:

image

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'.

carmel avatar Dec 12 '20 03:12 carmel

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"

Moshyfawn avatar Apr 12 '21 15:04 Moshyfawn