nuxt-community / svg-module

Super simple svg loading module for Nuxt.js
MIT License
340 stars 35 forks source link

[object Module] instead of src value #45

Closed mkrajinov closed 4 years ago

mkrajinov commented 4 years ago

Hi, I just update Nuxt to 2.18.2 and realize that svgs are not loading anymore. Instead of src path, I'm getting [object Module] value

sam3d commented 4 years ago

Hi, which version are you using? If you're not using the latest version, please try 0.1.11 (I think I fixed the issue you're having yesterday).

mkrajinov commented 4 years ago

Hi, I have already 0.1.11, loading from static is ok, but for assets is not working.

sam3d commented 4 years ago

Please could you provide a working reproduction link so I can take a look?

sam3d commented 4 years ago

Sorry, I meant a minimal working reproduction link to a codepen or something so I can see all of the relevant code you've been using. I can't diagnose much from a compiled website! 😄

taro-0 commented 4 years ago

Hi, we found this problem as Well. The latest version we were using didn't have this problem. It was only now that we upgraded to the most recent version that this problem came through.

I want to say that our team tried to downgrade the package but it didn't work

taro-0 commented 4 years ago

@krajinovicm i see you're using the fontawesome svg icon package along with the nuxt/svg package. @sam3d I want to add that we are using nuxt/svg-sprite along with these package. It might be that both packages change the default behaviour for how nuxt loads svg images

sam3d commented 4 years ago

Ooh that’s interesting, thank you for that note! It could very well likely be that it’s not compatible with svg-sprite. I’ll take a look into it and see if I can make them compatible with each other.

taro-0 commented 4 years ago

@sam3d thank you very much! I see that under the hood this module uses vue-svg-loader. I remember that at some point we had problem using a configuration for vue-svg-loader would it help a sample of our nuxt configuration for how we solved that problem?

mkrajinov commented 4 years ago

I can confirm that something with fontawesome caused issue for me. I did remove fontawesome and loading from assets started working well. Then I have added fontawesome again, and the issue is still not there anymore.