dart_edge icon indicating copy to clipboard operation
dart_edge copied to clipboard

Following doc tutorial results in `Function not found` error message

Open pedromassango opened this issue 2 years ago • 9 comments

Hi,

After following the steps in https://docs.dartedge.dev/platform/supabase I get a Not found message while trying to test the function locally (http://localhost:54321/functions/v1/dart_edge).

Screenshot 2023-08-16 at 2 02 11 AM

pedromassango avatar Aug 16 '23 01:08 pedromassango

You should see the generated code in the supabase directory in your project... is it there?

Ehesp avatar Aug 17 '23 15:08 Ehesp

It is there

pedromassango avatar Aug 17 '23 15:08 pedromassango

@Ehesp @pedromassango i am also facing same issue.

Screenshot 2023-11-07 at 7 35 07 PM

venkata-reddy-dev avatar Nov 07 '23 14:11 venkata-reddy-dev

had the same issue. It looks like it's putting the functions folder in the root instead of the supabase/functions folder. Moving the folder into the supabase folder gets the functions to work again

running the command edge build supabase_functions --dev -p supabase also seems to work.

adding

supabase:
  projectPath: "supabase"

to the yaml appears to have no effect.

tylandercasper avatar Nov 30 '23 20:11 tylandercasper

@tylandercasper @pedromassango @Ehesp

Add supabase configuration in edge.yml file

supabase:
  functions:
    task1: 'lib/task1.dart'
    task2: 'lib/task2.dart'
  project_path: "supabase"

For me it got worked.

venkata-reddy-dev avatar Dec 20 '23 04:12 venkata-reddy-dev

Having the same issue, this fix doesn´t work for me (or I´m using it wrong I guess), sad thing I can´t figure out the first steps just reading the docs. Edited: somewhere, between moving the function into the supabase folder and creating/modifying the edge.yml file, it worked...shouldn´t be a tweak from the users side, but a fix from the devs side, just saying.

alaincruz06 avatar Dec 21 '23 03:12 alaincruz06

I was able to get it working by adding this to the yaml:

supabase:
  project_path: "supabase"

you could probably be doubly safe by adding:

supabase:
  project_path: "supabase"
  projectPath: "supabase"

tylandercasper avatar Dec 23 '23 14:12 tylandercasper

running the command edge build supabase_functions --dev -p supabase also seems to work.

Hi there. We're facing the same issues, but currently they are related with supabase build -p option. The function is always transpiled to ./functions/dart_edge instead of ./supabase/functions/dart_edge. Any hints?

henry2man avatar Mar 12 '24 09:03 henry2man

Hi there. We're facing the same issues, but currently they are related with supabase build -p option. The function is always transpiled to ./functions/dart_edge instead of ./supabase/functions/dart_edge. Any hints?

In order to make this work you need to FIX dependencies in your pubspec.yaml file. For further reference, this is my pubspec.yaml

environment:
  sdk: ">=2.18.5 <3.0.0"

dependencies:
  edge: 0.0.6+1
  edge_http_client: ^0.0.1+3
  http: ^0.13.6
  json_annotation: ^4.8.1
  supabase: ^1.11.11
  supabase_functions: ^0.0.2+3

dev_dependencies:
  build_runner: any
  json_serializable: ^6.6.2

PS: Don't forget to reinstall dart edge in order to activate proper 0.0.6+1 version

henry2man avatar May 13 '24 15:05 henry2man