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

Public path not matched when build #25

Closed
Arthurin915 opened this issue Aug 26, 2021 · 7 comments · Fixed by #46
Closed

Public path not matched when build #25

Arthurin915 opened this issue Aug 26, 2021 · 7 comments · Fixed by #46

Comments

@Arthurin915
Copy link

Hello, when I try to use a svg from public path it works in the dev server, but breaks in build.
image

If I v-bind the image src in the template with the same path, it surprisingly works, even in build
image

Any thoughts on why i get an error trying to build a simple svg? I'm not even trying to import as a component...

@jpkleemans
Copy link
Owner

Hi, thanks for reporting. Could you share an example project so I can reproduce the problem, and investigate how to resolve it.

@Arthurin915
Copy link
Author

Hi, i created this repo to reproduce the issue:

https://github.com/Arthurin915/vite-svg-loader-issue

I'm also confused why the svg loader would run an error if i'm not even importing it as a component, i'm importing directly in the src img attribute.

Thanks, if you have any doubts about the repo please contact me

@jd-solanki
Copy link

I am also facing the same with the new vite project:
Screenshot 2021-10-27 at 11 37 04 PM

@nxmad
Copy link
Contributor

nxmad commented Mar 31, 2022

Looks like @jpkleemans is not maintaining this lib. I can confirm this problem still exists. Loader should ignore file if path starts with a forward slash.

@jpkleemans
Copy link
Owner

@nxmad I definitely do maintain this library (just did a new release last week), however it is hard for me to find much time for it in my spare time.
So, if you could help fix this issue by submitting a Pull Request for example, that would be very helpful!

@nxmad
Copy link
Contributor

nxmad commented Apr 5, 2022

@jpkleemans That's great to hear, thanks for your work. I'm not into plugins development so much. May be not the best solution, but at least it works - #46

@jpkleemans
Copy link
Owner

jpkleemans commented Apr 24, 2022

Fixed in v3.3.0

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.

4 participants