Hello,
I'm trying the local functions dev env. It's very useful.
I tried python-3.9 and it works out of the box But I can't get dart runtimes working. I tried dart-3.1 and dart-3.3
I've updated the docker compose .env
_APP_FUNCTIONS_RUNTIMES=node-16.0,php-8.0,python-3.9,ruby-3.0,dart-3.3,dotnet-3.1,dart-3.1
and downloaded the runtimes docker pull openruntimes/dart:v3-3.1 (tried v4-3.1 as well) docker pull openruntimes/dart:v3-3.3
then restarted the containers
Function is very basic:
import 'dart:async';
// This Appwrite function will be executed every time your function is triggered
Future<dynamic> main(final context) async {
return context.res.json({
'motto': 'Build like a team of hundreds_',
'learn': 'https://appwrite.io/docs',
'connect': 'https://appwrite.io/discord',
'getInspired': 'https://builtwith.appwrite.io',
});
}
The functions are well created but when I request the http://localhost:3000/ I get the following error:
Request body size exceeds the size limit.
#0 action (file:///usr/local/server/src/server.dart:33)
#1 main.<anonymous closure> (file:///usr/local/server/src/server.dart:196)
#2 handleRequest (package:shelf/shelf_io.dart:138)
#3 serveRequests.<anonymous closure>.<anonymous closure> (package:shelf/shelf_io.dart:91)
#4 _rootRunUnary (dart:async/zone.dart:1407)
#5 _CustomZone.runUnary (dart:async/zone.dart:1308)
#6 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217)
#7 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339)
#8 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271)
#9 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784)
#10 _StreamController._add (dart:async/stream_controller.dart:658)
.....
Am I missing something ?
Can you show example of the request body that is causing the issue
I just went to http://localhost:3000/ with a browser, it works for the python runtime
I guess it's an empty GET query
So you are not able to access your dashboard? m I right?
If yes then
Try these
docker compose down
docker compose up -d --remove-orphans
I'm calling a local function (run with 'appwrite run function'). How is it related to the dashboard ?
yes I'm able to access the dashboard
Try to execute your function from dashboard.
A local function does not exist in the dashboard. It exists only once you execute 'appwrite push functions'
Let me reproduce it on my side.
I used 'appwrite init functions' to create it
Recommended threads
- AppwriteException - Transaction with the...
I am using "node-appwrite" module and I have successfully created transaction id but when passing it to tablesDB.createRow function with some other required dat...
- Cannot create cloud function due to this...
As I try to deploy a new function to Github I get this error message: ``` Unable to clone code repository: fatal: ' ' is not a valid branch name hint: See `man ...
- How to use TS for creating appwrite func...
I was making a few appwrite functions but on doing the appwrite init setup process i always got main.js. Is there any way i can use TS?