-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[@astrojs/node] Image endpoint using default settings 404 in production after Astro v5 #13183
Comments
Please can you include a reproduction, using https://astro.new/repro |
I certainly can, but the issue only presents itself on production - any advice on how to use one of those repros to replicate a prod issue? Edit: also I can't seem to get the |
You can create a repro on StackBlitz on https://astro.new/repro. We can take it from there. You can run |
Notice this issue too, in production build, image broken after upgrade to astro 5.2.0 |
@twodft can you share a reproduction |
@lee-arnold are you using a Docker container to deploy your project? I am having this same problem, when I updated to Astro 5 from 4. I'm not sure if the issue relates to how the _image endpoint is constructing the url or the node adapter. But I only get the issue with Docker deployed. If we are talking aboutthe same thing, then I've already created a minimal reproduction to share on confirmation (requires a Docker build). |
This is my minimum reproduction that I hope highlights the 404 issue. Works fine in dev and local build, BUT if you use a docker image and upload to a server you get images not displaying properly as described above.
Run on any port thats not 8080. |
I use docker image too, after make a production build with While try the workaround by specifying the image entry point and then rebuild, it works. I had try make a simple reproduction, but failed through...🥲 |
I think updating https://github.com/withastro/astro/blob/main/packages/integrations/node/src/index.ts#L38-L40 (as you said) should do the job, do you want to submit a PR? |
@BrettJackson1987 thanks so much for nailing that down - it does indeed only appear in docker containers, and I've finally confirmed that for my project too. @florian-lefebvre happy to! |
Astro Info
Describe the Bug
When using the Node adapter in standalone mode, upgrading from Astro v4 to v5 causes all image urls to 404. This only occurs in production.
Adding this config fixes the issue:
I think the issue is that
image.endpoint
in astro v5 was changed toimage.endpoint.route
andimage.endpoint.entrypoint
, so I think that it needs to be updated here too.Current:
Should be:(?)
What's the expected result?
Images shouldn't 404
Link to Minimal Reproducible Example
n/a
Participation
The text was updated successfully, but these errors were encountered: