-
Notifications
You must be signed in to change notification settings - Fork 916
vue-loader not processing images in dynamic component #814
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
Comments
Can you tell me a specific component that this is happening for so I don't havd to look through your whole project? That would be helpful, thanks :) |
Thank you (very much) for the help. Yes, in the assets/modals folder any of the three modals ( for example modalPrintAdvil.vue) have src files (which are hard coded/not dynamic links) that are not being processed and hashed like the other non-dynamic components. I hope this clears things up. Thanks again. |
You need to use relative paths (start with |
Update First issue solved with a slight change to Evan's comment above. Evan, Thank you for taking the time to look into this. My webpack aliases are set to
In the modalPrintAdvil.vue template component - I'm not sure why (for the production build): This path alias does not work: This relative path does not work: This works: I will also share this with Juho, one of the webpack contributors, and see if he can shine a bit of light on why the path aliases within a vue template component are not working. I will report back. ======== Second Issue Solved - See StackOverflow link Below ======== This works great for the dev build but for production it does not process the images. As a workaround I have placed all of these thumbnail images in
This partially solves the issue but it does not take advantage of hashed image names and links for caching. I tried the I am researching: vuejs/Discussion#202 the Stack Overflow link in this discussion is the solution that worked for dynamic URLs in the Vue Template files: in case the link dies here is the fiddle code:
This approach has the programmatic links for the thumbnail images called my modal-button.vue component being processed and hashed through the appropriate loader without the need for the subdirectory/Copy Webpack Plugin workaround. The repo has been updated with the above fixes: I hope this helps others. Thanks again. |
Try this link 👉🏻this works for me. |
|
@kaankucukx Works, thanks a lot. |
@kaankucukx You're a life saver, thanks 😂 |
I also had this problem almost stole my 48 hours, Initially i thought the error was programatic, and then after googling researching i never even found out the cause of the error, At some point i read a post and the guy revealed that his missing assets were not bundled, Oh mY! so how do i solve this problem? the bundler is missing the files? what do i do? Initial tests:
Solution: so on same server i created another folder "dynamic-assets" The trick however is to know exactly your server root, and point your dynamic files directly, Make sure your path starts with your server root eg: www.solve.com, concatenate it with your file path, Next put your unhashed images in "dynamic-assets" and add them in your lib folder, so you have Solved. Try find other solutions that you might prefer, cheers. |
Uh oh!
There was an error while loading. Please reload this page.
Vue Team,
Thanks for all that you do for the dev community.
I'm not sure if this is an issue or a configuration problem. One of the contributors to webpack has been helping me sort an issue but we are at a point where he thinks it may be a vue-loader issue.
I have a dynamic component/slot that is called via the data captured and passed by an Event Bus. This all work great and in development mode everything works as expected. When I build out the production folder the dynamic .vue template files are processed and placed in the correct directory (in the assets/modals folder) but none of the hard/static coded src links or src images in the template files are processed (no image hash and link hash updates are applied).
I have a setup on github that's working via a hack (I am using Copy Webpack Plugin to copy over all the files in the directory) but this is just a quick fix for the above outlined issue.
Here is the github repository:
https://github.com/jh-thank-you/webpack-w-gsap
Thanks again.
All the best,
Jim
The text was updated successfully, but these errors were encountered: