Files
feeddeck/supabase
Rico Berger a9b4bef96f Update Deno Version to 1.45.2 (#242)
* Update Deno Version to 1.45.2

Update Deno Version in the Docker image to version 1.45.2 and update the
`@supabase/supabase-js` dependency specified in the `import_map.json`
file.

**NOTES:**

- The current recommended approach for managing dependencies is using a
  `deno.json` file, which is currently not working locally and returns
  the following error:

```
serving the request with supabase/functions/add-or-update-source-v1
worker boot error: failed to create the graph: Relative import path "@supabase/supabase-js" not prefixed with / or ./ or ../
    at file:///Users/ricoberger/Documents/GitHub/feeddeck/feeddeck/supabase/functions/add-or-update-source-v1/index.ts:1:30
worker boot error: failed to create the graph: Relative import path "@supabase/supabase-js" not prefixed with / or ./ or ../
    at file:///Users/ricoberger/Documents/GitHub/feeddeck/feeddeck/supabase/functions/add-or-update-source-v1/index.ts:1:30
InvalidWorkerCreation: worker boot error: failed to create the graph: Relative import path "@supabase/supabase-js" not prefixed with / or ./ or ../
    at file:///Users/ricoberger/Documents/GitHub/feeddeck/feeddeck/supabase/functions/add-or-update-source-v1/index.ts:1:30
    at async UserWorker.create (ext:sb_user_workers/user_workers.js:139:15)
    at async Object.handler (file:///root/index.ts:157:22)
    at async respond (ext:sb_core_main_js/js/http.js:197:14) {
  name: "InvalidWorkerCreation"
}
```

- When using Deno v2 the dependencies via the `deno.json` file are
  working. To enable Deno v2 the following must be set in the
  `config.toml` file:

```
[edge_runtime]
deno_version = 2
```

- Deno v2 is currently only supported locally, see
  https://supabase.com/blog/supabase-edge-functions-deploy-dashboard-deno-2-1#deno-21-preview

- Once Deno v2 is supported in the hosted platform, we should switch
  from the `import_map.json` to `deno.json` to manage dependencies and
  update the existing dependencies.

* Fix Errors

- Replace `err.toString()` with just `err` when logging errors.
- Add new `blobToFile` function, to upload files to the Supabase
  storage, otherwise we receive the following error (https://github.com/feeddeck/feeddeck/actions/runs/14546547197/job/40812707871):

```
error: TS2345 [ERROR]: Argument of type 'Blob' is not assignable to parameter of type 'FileBody'.
  Type 'Blob' is missing the following properties from type 'File': lastModified, name, webkitRelativePath
        file,
        ~~~~
    at file:///home/runner/work/feeddeck/feeddeck/supabase/functions/_shared/feed/utils/uploadFile.ts:66:9
```
2025-04-19 09:10:43 +02:00
..
2024-02-06 21:05:40 +01:00
2023-09-03 16:16:38 +02:00
2023-09-03 16:16:38 +02:00
2023-09-03 16:16:38 +02:00