I try to work with supabase edge functions in a Deno environment in IntelliJ Ultimate. The corresponding plugin is already installed but inside my supabase folder the functions I wanna create do not support Deno IntelliSense which makes things quite hard.
Folder Structure:

I don't know why my IntelliSense breaks when working with Deno and/or how to retrieve the correct types from packages imported via import_map.json
import_map.json
{
"imports": {
"stripe": "https://esm.sh/[email protected]?target=deno",
"std/server": "https://deno.land/[email protected]/http/server.ts"
}
}
index.ts inside my 'get-ticket-information' function folder (The code is probably correct, but shows me errors because of missing types):
import { serve } from 'std/server'
import Stripe from 'stripe'
const stripe = new Stripe(Deno.env.get('STRIPE_SECRET_KEY') as string, {
apiVersion: '2022-11-15',
httpClient: Stripe.createFetchHttpClient(),
})
When trying to deploy to supabase via
supabase functions deploy --no-verify-jwt get-ticket-information --debug
I do receive the following error too:
Uncaught (in promise) Error: Relative import path "http" not prefixed with / or ./ or ../ and not in import map from "https://esm.sh/v108/@types/[email protected]/http.d.ts"
const ret = new Error(getStringFromWasm0(arg0, arg1));
Regarding the runtime error:
The Supabase CLI documentation for supabase functions deploy suggests that you must provide a path to the import map at the time of invocation:
supabase functions deploy
Deploy a Function to the linked Supabase project.
Basic usage:
supabase functions deploy <Function name> [flags]Flags:
--import-map <string>Path to import map file.
...cont.
Regarding import maps as they relate to IDE integration and types:
This has already been covered on Stack Overflow here, and is also covered in the manual in section 3.3: Import Maps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With