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

SVG is loading is not loading as a component #57

Closed
abdul-alhasany opened this issue Jun 23, 2022 · 1 comment · Fixed by #58
Closed

SVG is loading is not loading as a component #57

abdul-alhasany opened this issue Jun 23, 2022 · 1 comment · Fixed by #58

Comments

@abdul-alhasany
Copy link
Contributor

abdul-alhasany commented Jun 23, 2022

Hi
The plugin does not seem to load the svg file as a component.

I imported svg file like this:

import ThankYou from '/images/illustrations/placeholders/thankyou.svg?component';

I also setup vite.config.ts like so:

svgLoader({
   defaultImport: 'component',
})

Despite all that I get this error:

Uncaught (in promise) DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('/images/illustrations/placeholders/thankyou.svg?component') is not a valid name

I am using version 3.4.0, which supposed to solve this issue as stated here: #51

@abdul-alhasany
Copy link
Contributor Author

It was an issue because file did not exist on that path. It would be easier if an error message was displayed stating the error.

I created a pull request to show the error when the file can not be loaded.

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

Successfully merging a pull request may close this issue.

1 participant