You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The SupabaseClient constructor throws "Cannot create a client without dart:html or dart:io." error when used in Supabase Dart Edge functions with the supabase_functions package.
An error message looks like the following:
[Error] ub {
a: "Cannot create a client without dart:html or dart:io.",
"$thrownJsError": Unsupported operation: Cannot create a client without dart:html or dart:io.
at Object.J (file:///home/deno/functions/dart_edge/main.dart.js:246:3)
at Object.v (file:///home/deno/functions/dart_edge/main.dart.js:253:14)
at Object.wV (file:///home/deno/functions/dart_edge/main.dart.js:2861:15)
at Object.e2 (file:///home/deno/functions/dart_edge/main.dart.js:2859:14)
at Object.Xa (file:///home/deno/functions/dart_edge/main.dart.js:2685:3)
at e.$1 (file:///home/deno/functions/dart_edge/main.dart.js:5492:8)
at file:///home/deno/functions/dart_edge/main.dart.js:5516:19
at Gs.a (file:///home/deno/functions/dart_edge/main.dart.js:1401:63)
at Gs.$2 (file:///home/deno/functions/dart_edge/main.dart.js:3545:14)
at Object.DI (file:///home/deno/functions/dart_edge/main.dart.js:1381:11)
}
To Reproduce main.dart:
import'package:edge_http_client/edge_http_client.dart';
import'package:supabase/supabase.dart';
import'package:supabase_functions/supabase_functions.dart';
voidmain() {
SupabaseFunctions(fetch: (request) {
final supabaseUrl =Deno.env.get('SUPABASE_URL')!;
final supabaseKey =Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!;
// This SupabaseClient constructor throws an error:SupabaseClient(
supabaseUrl,
supabaseKey,
httpClient:EdgeHttpClient(),
);
returnResponse('OK');
});
}
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 darwin-arm64, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Community Edition (version 2023.1.4)
[✓] VS Code (version 1.82.2)
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 1 category.
The text was updated successfully, but these errors were encountered:
Describe the bug
The
SupabaseClient
constructor throws"Cannot create a client without dart:html or dart:io."
error when used in Supabase Dart Edge functions with the supabase_functions package.An error message looks like the following:
To Reproduce
main.dart
:pubspec.yaml
:Steps to reproduce the behavior:
dart_edge
function using Postman/curl/etc.Internal Server Error
response and an error message in the functions console.Version:
supabase_flutter_test 1.0.0
├── supabase 1.11.9
│ ├── functions_client 1.3.2
│ ├── gotrue 1.12.4
│ ├── postgrest 1.5.1
│ ├── realtime_client 1.3.0
│ ├── storage_client 1.5.3
└── supabase_functions 0.0.2+4
Additional context
flutter doctor
output:The text was updated successfully, but these errors were encountered: