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!

Did you ever figure this out? I am getting the same error when I try to run netlify dev for local server on a nextjs project that has worked for a while. Just curious.

-Bob

What site are you referring to?

It’s not happening on the site. It’s happening locally for me when I enter netlify dev in command line. I have changes for the site but until I can get it running locally I’m holding off updating the site on netlify.

Ahh okay. Well when you get it working locally we will be able to help.

Im facing this issue. Any solutions for this ?

This error is with local netlifycli - is there no solution? The issue continues

It’s better to report issues directly to CLI repo: GitHub - netlify/cli: Netlify Command Line Interface