© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•10mo ago
James Eastham

Service Bindings on NextJS

Hey everyone, I'm trying to get a NextJS setup on workers. My NextJS app needs to make a call out to another worker, which is setup as a service binding. I've gone through the steps of using
wrangler types
wrangler types
to generate types, have the latest versions of everything. But whenever I make a call to
getRequestContext()
getRequestContext()
I get an error saying that the Cloudflare Request Context can't be loaded.

The other challenge I've got, is that when I set
export const runtime = edge
export const runtime = edge
I get another error saying

OpenNext requires edge runtime function to be defined in a separate function.
See the docs for more information on how to bundle edge runtime functions.
OpenNext requires edge runtime function to be defined in a separate function.
See the docs for more information on how to bundle edge runtime functions.


Does anyone know exactly which docs that is referring to?

Thanks in advance
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Service bindings
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
service bindings typescript
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
Cloudflare Service bindings with nuxt
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Smart Placement and Service Bindings
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago