invertase / dart_edge

Run Dart on the Edge - supporting Vercel & Cloudflare Workers (more coming soon).
https://docs.dartedge.dev
Apache License 2.0
324 stars 23 forks source link

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

Open pedromassango opened 1 year ago

pedromassango commented 1 year ago

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
Ehesp commented 1 year ago

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

pedromassango commented 1 year ago

It is there

venkata-reddy-dev commented 1 year ago

@Ehesp @pedromassango i am also facing same issue.

Screenshot 2023-11-07 at 7 35 07 PM
tylandercasper commented 12 months ago

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.

venkata-reddy-dev commented 11 months ago

@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.

alaincruz06 commented 11 months ago

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.

tylandercasper commented 11 months ago

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"
henry2man commented 8 months ago

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 commented 6 months ago

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