Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
carmel opened this issue Dec 12, 2020 · 1 comment
Open

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

carmel opened this issue Dec 12, 2020 · 1 comment

Comments

@carmel
Copy link

carmel commented Dec 12, 2020

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

@Moshyfawn
Copy link

Moshyfawn commented Apr 12, 2021

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants