Skip to content
Back

CORS preflight returns 500 on Dart function (context.res.text() / .empty() not found)

  • 0
  • 2
  • Functions
  • Cloud
tom
5 Nov, 2025, 00:25

Hey everyone 👋 I’m running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: NoSuchMethodError: Class 'RuntimeResponse' has no instance method 'text' or 'empty' I've treid these

TypeScript
return context.res.empty(status: 204, headers: headers);
return context.res.json({}, 204, headers);````

None of them seem to exist on the runtime’s context.res.
So I’m wondering:
Which context.res methods are actually available in the Dart 3.x Appwrite runtime?
Is there an updated way to send a plain response with custom headers (e.g. for CORS preflight)?
TL;DR
The issue is related to missing functions in Dart. Need to check the Dart documentation for proper usage.
20 Dec, 2025, 19:08

same, did you figure it out?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more