Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Async/Await on appengine

When I use async await methods, I get the following error on google dart appengine, how can we use async await on app engine?

INFO: Creating container... INFO: Container
e40102016036bcc2bc36a3b4f5a39c2c427a107e8ead3f86d025cdce950e25af
created. DEBUG: Container: e40102016036: Observatory listening on
http://a.domain:8181 DEBUG: Container: e40102016036:
'package:forcemvc/server/serving_files.dart': error: line 46 pos 71:
use flag --enable-async to enable async/await features Future
serveFile(HttpRequest request, String root, String fileName) async { ^
DEBUG: Automatic cleanup... DEBUG: Cleanup finished. INFO: default:
"GET /_ah/health?IsLastSuccessful=no HTTP/1.1" 503 - DEBUG: Health
check response [''] and status 503 Service Unavailable for instance 0.
DEBUG: Health check state for instance: 0: 3 consecutive UNHEALTHY
responses. DEBUG: Performing health check for instance 0.

like image 543
Joris Hermans Avatar asked Dec 07 '25 22:12

Joris Hermans


1 Answers

Add --enable-async to the DART_VM_OPTIONS environment variable.
You can set it using the app.yaml file like:

env_variables:
  DART_VM_OPTIONS: '--enable-async'

You might need to update to the most recent Dart Docker image (for example google/dart-runtime - updated 4h ago)

like image 67
Günter Zöchbauer Avatar answered Dec 09 '25 18:12

Günter Zöchbauer