Strange Cloudflare Pages Astro Deploy Error

A relatively simple Astro web app with some dynamic routes.

The build deploys just fine but i get a blank screen. on reload i get a 500 error status: GET https://medaffairsexperts.pages.dev/ [HTTP/3 500 32ms]

When trying the build locally with wrangler i get: service core:user:worker: Uncaught Error: No such module “node:path”. On cloudflare i did add the nodejs_compat compatibility flag.

my astro.config.mjs looks like this:

export default defineConfig({
  site: config.site.base_url ? config.site.base_url : "http://localhost:4321", // TODO: change to actual url
  base: config.site.base_path ? config.site.base_path : "/",
  trailingSlash: config.site.trailing_slash ? "always" : "never",
  image: {
    service: squooshImageService(),
  },

  integrations: [
    react(),
    sitemap(),
    tailwind({
      config: {
        applyBaseStyles: false,
      },
    }),
    AutoImport({
      imports: [
        "@/shortcodes/Button",
        "@/shortcodes/Accordion",
        "@/shortcodes/Notice",
        "@/shortcodes/Video",
        "@/shortcodes/Youtube",
        "@/shortcodes/Tabs",
        "@/shortcodes/Tab",
      ],
    }),
    mdx(),
  ],
  markdown: {
    remarkPlugins: [
      remarkToc,
      [
        remarkCollapse,
        {
          test: "Table of contents",
        },
      ],
    ],
    shikiConfig: {
      theme: "one-dark-pro",
      wrap: true,
    },
    extendDefaultPlugins: true,
  },
  output: "server",
  adapter: cloudflare({
    mode: "directory",
  }),
  vite: {
    plugins: [viteTsconfigPaths()],
  },
});

anyone encountered this strange behavior before or has an idea why it is happening?
thank you in advance for your answer

The only thing i can think of is that I am using the supabase package to authenticate. could this package be the one that is throwing the node compat errors?

import { supabase } from "@/lib/supabase";