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
⚠️ Duplicated file name anywhere inside the src/
folder. Not Allowed?
#10936
Comments
src/
folder; Not Allowed?src/
folder. Not Allowed?
This seems like a bug, not a Docs problem. I'm gonna transfer this to the core repo :) Can you make a reproduction example? |
Hello @RealKendpr. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
I just made a reproduction: |
Two files with the same content and filename both ended up pointing to In Astro did not recognize that the image was still being used by astro/packages/astro/src/assets/build/generate.ts Lines 113 to 129 in 9a231a4
|
Thanks for pointing out whats causing this. Can having two copy of image be implemented? But I think there is also an upside to this, since you are only using same file from the same path, the browser wont have to load the same image twice. |
Also the generated file name for |
Also, may I ask why you chose to directly use the |
@RealKendpr In the future please do not remove the form information that you filled out when filing the issue. Being able to quickly scan that makes it easier to triage a bug. Thank you. |
There was no form information @matthewp. This started as a docs issue and I transfered it here. |
Oh ok, np then. My apologies @RealKendpr, I didn't realize this started as a docs issue. |
The Also I just discovered about passing the |
Just an update to this issuewhen using both regular html
<div>
<h2>Image inside the src/imgs/</h2>
<img
src={img.src}
alt=""
/>
</div>
<div>
<h2>Image inside the src/imgs, using the Astro's <Image /></h2>
<Image
loading="lazy"
src={img}
alt=""
/>
</div> also the same with using
|
Astro uses the absolute path of image file before processing as a unique identifier when determining whether images is referenced. |
Does having similar file name inside and anywhere in the
src/
folder not allowed?I had a file structure kind of like this:
the image inside the
src/imgs/
is used by a component and the one inside thepost/thumbnails/
is used by a post. I did it so the thumbnails are near the posts and to keep it organized.it works fine on dev mode but when I deploy it and build, one of the images are not found. it seems only one of them are included after build.
The text was updated successfully, but these errors were encountered: