My editor is showing a TypeScript error for a Deno module I am working on.
The import path "$fresh/dev.ts" should be prefixed with / or ./ or ../
I have an import_map.json
file set up with the following content.
{
"imports": {
"$fresh/": "https://deno.land/x/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a3c5d1c6d0cbe3928d928d91">[email protected]</a>/",
"preact": "https://esm.sh/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a0a081f1b190e3a4b4a544b4b544a">[email protected]</a>",
"preact/": "https://esm.sh/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6a6a4b3b7b5a296e7e6f8e7e7f8e6">[email protected]</a>/",
"preact-render-to-string": "https://esm.sh/*<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="176765727674633a6572797372653a63783a6463657e7970572239253923">[email protected]</a>",
"@preact/signals": "https://esm.sh/*@preact/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="addec4cac3ccc1deed9c839d839e">[email protected]</a>",
"@preact/signals-core": "https://esm.sh/*@preact/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13607a747d727f603e707c617653223d233d22">[email protected]</a>",
"twind": "https://esm.sh/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f18586...
The VSCode TypeScript language server has crashed a couple times, too. It seems to be related to this issue.
This code was generated by the Deno Fresh project template and hasn't been modified. According to the map, TypeScript should accept these imports.
Unless the map is not being recognized properly. There's a possibility that Deno needs an update to align with recent changes in the specification.
What do you think could be causing this error?
It appears that the GitHub issue "Support import maps and bare import specifiers" is still unresolved for TS.
Should I just ignore this error and avoid making changes to these files?