N
Nuxt3mo ago
bnason

Import image from node_modules

Is there a way to use an image from a package in node_modules? I need to provide the URL to the library. Using import inside my script setup gives me a URL, but it fails to load with a 404.
2 Replies
kapa.ai
kapa.ai3mo ago
Hi @bnason. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain explicit information about how to use or import images directly from node_modules in a Nuxt project. The available sources discuss importing images from the assets or public directories, and mention that importing images with import statements works for those locations, but do not address node_modules specifically. If you need to use images from node_modules, you may need to move them to the public or assets directory, as suggested in related discussions about image handling in Nuxt 3 projectsNuxt 3 dynamic images. If you have further details or a specific use case, please provide them, and I'll do my best to help based on the available documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@712351223482810390> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?