where only remixContext is passed into <RemixServer ... /> and appears that loadContext has the fetcher and it not used in this iteration of remix + cloudfare-pages.
I think I've searched as deep as I can on this issue, and it appears that either remix and/or @remix-run/cloudflare projects have made changes to context that the documentation/examples in the remix-image repo might not be up-to-date with.
context.ASSETS.fetch
is undefined at runtimeUsing the cloudflare-pages example I am running into issues with the
context.ASSETS.fetch(...)
fetcher not being defined.I think I have narrowed it down to
entry.server.tsx
having bothremixContext
&loadContext
,where only
remixContext
is passed into<RemixServer ... />
and appears thatloadContext
has the fetcher and it not used in this iteration ofremix
+cloudfare-pages
.I think I've searched as deep as I can on this issue, and it appears that either
remix
and/or@remix-run/cloudflare
projects have made changes to context that the documentation/examples in theremix-image
repo might not be up-to-date with.Your Example Website or App
https://github.com/jamespsterling/jamespsterling-remix/tree/remix-image/app
Steps to Reproduce the Bug or Issue
This is a runtime issue with the context, check the repo link for the code.
Expected behavior
The
fetcher
should be available at runtime, wondering if I need to combine both contexts to be able to use them in the imageloader.
Screenshots or Videos
Here is the
entry.server.tsx
, https://github.com/jamespsterling/jamespsterling-remix/blob/remix-image/app/entry.server.tsx#L17Here is the image
loader
,https://github.com/jamespsterling/jamespsterling-remix/blob/remix-image/app/routes/_public.api.image._index.tsx#L16
Platform
Dependency versions
Additional context
Here are some threads around the changes to
loadContext: AppLoadContext
,https://github.com/remix-run/remix/pull/5836 https://github.com/remix-run/remix/pull/2045 https://github.com/remix-run/remix/discussions/5314
Thread on changes to static
context.ASSETS
, https://github.com/cloudflare/workers-sdk/issues/1162Using React 18 Streaming w/ Remix, https://remix.run/docs/en/main/guides/streaming#enable-react-18-streaming