/.netlify/images endpoint not functional when doing Github Action builds

I want to use the /.netlify/images endpoint, but for some reason, my netlify hosted website shows my Sveltekit 404 page instead of the netlify 404 page.

What I expect: https://image-cdn-playground.netlify.app/.netlify/images?url=example.com
What I get: https://pauseai.info/.netlify/images?url=example.com

However, I noticed that when I build my website using the CLI, this problem disappears! I suddenly get it working! https://66f6787d6d45dc0303fff7bf--pauseai.netlify.app/.netlify/images?url=example.com

Just to be clear: focus on the 404 page, and what is handling it. You can see if netlify handles it (which means the endpoint is called) or sveltekit (which means it’s not called).

Anyone has any idea?

@joepio The answer will be functions/middleware, likely the Svelte Netlify Adapter:
https://kit.svelte.dev/docs/adapter-netlify

The difference between the default ‘static’ handling and some custom function based behavior.

Checking the headers for the responses reveals it.

The CDN playground looks like a standard Netlify response:

Your site is reporting as X-Sveltekit-Page

The site you’ve built locally as ‘static’ and deployed to the CDN also has a standard Netlify response:

Thanks for the fast reply! Well-spotted.

I’m still a bit surprised by how this difference can happen. In both the github build, as well as the local build, I use the @sveltejs/adapter-netlify, so I’m still surprised to see a different result in both. Are you saying that the adapter is only used in the github pipeline? The weird thing is both use pnpm build.

Not intentionally.
All I know is that “one of these things is not like the others”.

I don’t work with Sveltekit so am not familiar with its peculiarities.

Comparing the builds configurations, (in particular the config for the adapter), may shine some light on it.