My situation involves two edge functions, namely create-payment-link
and retrieve-payment-link
. However, they are currently utilizing the import map located at /home/deno/flag_import_map.json
, rather than the import_map.json
file within the functions
folder. As a result, they are encountering an error stating that x was not mapped in import map.
where x represents a specific package they each require.
Both of these functions share the following imports:
import { serve } from "server"
import * as cryptojs from "crypto-js";
import { config } from "dotenv";
The contents of import_map.json
are as follows:
{
"imports": {
"server": "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="394a4d5d790917080f011709">[email protected]</a>/http/server.ts",
"crypto-js": "https://cdn.skypack.dev/crypto-js",
"dotenv": "https://deno.land/x/dotenv/mod.ts"
}
}
This issue arises when attempting to locally serve both functions using the command:
npx supabase functions serve --debug --env-file ./supabase/.env --import-map ./supabase/functions/import_map.json
However, serving them individually with
npx supabase functions serve function-name --debug --env-file ./supabase/.env
seems to work without any problems.