Cannot deploy Edge Function
I've recently started seeing the following error for an Edge Function that used to work fine:
"worker boot error: Uncaught SyntaxError: The requested module 'https://esm.sh/contentful-management@11.41.0' does not provide an export named 'default'\n at file:///var/tmp/sb-compile-edge-runtime/transactional/contentful.ts:1:8"
Here is the offending code:
What I've tried:
- Referencing npm directly in the import: import contentfulMgmt from "npm:contentful-management@11.41.0";
- Using a wildcard import: import * as contentfulMgmt from "https://esm.sh/contentful-management@11.41.0";
- Deploying from the CLI with the --debug flag (When I tried this, it hangs at the following point:
I'm at my wits end as to what is going on! This same Edge Function was working yesterday just fine.1 Reply
I ultimately was able to get this to deploy by using the
--use-api flag on the CLI. While I'm not sure why that fixed the issue (was I not already using the API? Or perhaps that's just confusing naming?), this appears to be working now.