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/"