Closed martior closed 2 months ago
Hi @martior,
this is (unfortunately) a known issue.
This seems at this point more like an accident on the Next.js side. A similar issue has recently been resolved from their side in https://github.com/vercel/next.js/pull/56501, but runtime = "edge"
is still being investigated by them.
Checked with webpack team that exports checking needs to be applied to package. There seems no way to partially disable the exports checking for certain package (like react) in certain runtime (such as edge runtime). As apollo-client in edge runtime might still access some unexisted property for running conditional code, one solution I got from webpack team is to use Object(React).<property>
e.g. Object(React).createContext
to get rid of the check. So it could also use that to do it.
@huozhi Thank you for the update! At this point we will probably consider using a wrapper package around React to deal with that - we can't be sure if a hack that works with one bundler today will break with the next bundler tomorrow.
@phryneas are there any updates on this? sorry to chase .. !
@bashaus actually, there are! You should be able to use the Apollo Client 3.9 alphas in the Edge runtime.
I'm doing some housekeeping so I'm closing some older issues that haven't seen activity in a while. If this is still relevant, please feel free to reopen the issue.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
importing
from a app/page.tsx with
export const runtime = "edge";
gives the following error:It works if you remove export const runtime = "edge"