Search code examples
dockerexpresssupabasedeno

Supabase local edge function is not printing console.log statements to the terminal


I have a Supabase edge function that runs locally. The function uses express.js for routing.

It basically looks like this:

import "jsr:@supabase/functions-js/edge-runtime.d.ts";

// @deno-types="npm:@types/express@5.0.0"
import express from 'npm:express@4.21.1';
import cors from 'npm:cors@2.8.5';
import { isUsernameAvailable } from "./endpoints/entity/is-username-available.ts";

const app = express();
app.use(cors());

app.all('/api/*', (req, _res, next) => {
  req.url = req.url.replace(/^\/api/, '');
  console.log("TESTING");
  next();
});

app.get('/entity/is-username-available', isUsernameAvailable);

This function works fine, but console.log statements are simply not working - no matter where in the code I put it.

I have the latest Supabase, Deno, and Docker versions. Supabase 2.1.1, Deno 2.1.4, and Docker 4.37.1.

What am I missing?


Solution

  • I had the same Problem today. A downgrade from the CLI version to 2.1.4 solved this issue

    https://github.com/orgs/supabase/discussions/32507