Cryptic relative import error when loading edge functions on Netlify CLI

I’m building a project that is entirely edge functions, no website/server. I had been experiencing issues with edge functions not deploying, so I updated my netlify-cli. However, now that I’ve updated, I’m getting a weird error when I use the netlify-cli dev server:

◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ No app server detected. Using simple static server
◈ Running static server from "myproj/static"
◈ Setting up local development server

◈ Static server listening to 3999

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

◈ Loaded edge function root
error: Relative import path "undefined" not prefixed with / or ./ or ../ and not in import map from "file:///var/folders/l_/sw5l9f4s6cq4hlzycrlrxzq40000gs/T/tmp-65293-6WQGSBfgW8Hi/dev.js"
    at file:///var/folders/l_/sw5l9f4s6cq4hlzycrlrxzq40000gs/T/tmp-65293-6WQGSBfgW8Hi/dev.js:1:22
◈ Reloading edge functions...
error: Relative import path "undefined" not prefixed with / or ./ or ../ and not in import map from "file:///var/folders/l_/sw5l9f4s6cq4hlzycrlrxzq40000gs/T/tmp-65293-6WQGSBfgW8Hi/dev.js"
    at file:///var/folders/l_/sw5l9f4s6cq4hlzycrlrxzq40000gs/T/tmp-65293-6WQGSBfgW8Hi/dev.js:1:22
◈ Failed reloading edge function

I can’t work out what is causing this issue. Here’s my only edge function:

// src/root.ts
import { Config } from "https://edge.netlify.com";

export default async (request: Request) => {
	const url = new URL(request.url);
	const gif = await (
		await fetch(
			`https://tenor.googleapis.com/v2/posts?key=${Deno.env.get(
				"TENOR_KEY"
			)}&ids=${url.pathname.match(/(\d+)\/*$/)?.[1]}&media_filter=gif`
		)
	).json();
	return fetch(gif.results[0].media_formats.gif.url);
};
export const config: Config = {
	path: "/view*",
};

and here’s my netlify.toml:

[build]
	edge_functions = "src/"
	publish = "static/"

I have started seeing this error also.
The offending line in my auto-generated edge function import path file (which is at a different tmp location to the OP) is:
import { boot } from "undefined";
This happened before and after upgrading netlify-cli to the latest version.

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!