I know that Deno doesn’t support package imports but when I add the following into my edge functions code (using Typescript), it doesn’t include the Context type with autocomplete/intellisense.
import type { Context } from "https://edge.netlify.com" // Context doesn't include intellisense
I get the following error in VSCode
Cannot find module 'https://edge.netlify.com' or its corresponding type declarations.
I can locally add in the type using the following, but I imagine I might be doing something wrong for local dev. I read through this post, but wasn’t able to figure out how url imports work with types in local development.
Hi @mikec, there is a similar thread on this forum discussing the problem you are experiencing with imports regarding edge functions.
Kindly check the link below to visit the post thread.
Kindly try out the suggestions in post and let me know the outcome.
Ahh I see what happened, I had to install the Deno VS Code extension in VS Code and now it works!
I think that when I ran ntl dev, it initially tried to set it up in a .vscode folder for me but didn’t seem to configure it. For reference, it created the following three files in a .vscode folder: