astro-imagetools: Astro 1.0.2: In production, images are not being transformed
Since Astro 1.0.2, the links to images transformed by astro-imagetools are broken in production only, 404. I tried referencing images from .md
frontmatter as well as images within .mdx
file using the <Picture />
component. While I’m getting the blurred up versions of the images, the link to the final images are all broken and no images have been transformed regardless of what the CLI tells me.
- The path to my images resides in
/public/images
since Astro 0.2.x - Not using Astro SSR
- Using Astro 1.0.3,
"astro-imagetools": "^0.6.10"
with npm
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 11
- Comments: 21 (3 by maintainers)
Commits related to this issue
- fix #111: output generated assets — committed to germanz/astro-imagetools by germanz 2 years ago
- fix #111: output generated assets — committed to germanz/astro-imagetools by germanz 2 years ago
- Update dependencies Locking `astro` to `1.0.1` to side-step issues with https://github.com/RafidMuhymin/astro-imagetools/issues/111 (for now). — committed to sucho-archiving/meme-wall by simonwiles 2 years ago
- added patch for bug described in https://github.com/RafidMuhymin/astro-imagetools/issues/111 — committed to beeb/astro-image-repro by beeb 2 years ago
- fix #111: output generated assets (#115) — committed to RafidMuhymin/astro-imagetools by germanz 2 years ago
+1. This bug is critical. It makes astro-imagetools completely unsustainable to use in the long run, because we cannot update the Astro version until this gets fixed.
@RafidMuhymin any chance we could merge #115 and release a new version? We really need support for Astro v1 here.
Raised a PR to fix this for SSG. SSR with the
node
adapter still has issues though, despite callingcloseBuild
, the asset store is empty.Yep, I’m finding the same that images don’t work when running build/preview, but do work when running develop.
I’ve rolled back to
"astro": "1.0.0-rc.7"
and everything is working as expected again.I had tested with all the latest astro versions, up to 1.0.5
npm: https://www.npmjs.com/package/patch-package pnpm: https://pnpm.io/cli/patch yarn: https://yarnpkg.com/cli/patch
With these you should be able to manually add the line from #115 and commit it to git. You may need to use
"astro:build:done"
as the hook (https://github.com/RafidMuhymin/astro-imagetools/pull/115#issuecomment-1230936973)I have had the patch applied for a few days and the build seems fine
@Tc-001 I think the easiest is to put those lines in your Astro config file:
I confirm the issue is still present with Astro v1.0.8. I hope this to be fixed asap. It is indeed a critical issue.
I could temporarily solve the problem with the fix submitted by @npmrun, https://github.com/RafidMuhymin/astro-imagetools/issues/111#issuecomment-1223765068 Thank you very much!
node_modules\astro-imagetools\integration\index.js
add this codeIt worked for me ,I think this is not a good way to solve it, but that’s all I can do for now