fresh: Relative import path "preact" not prefixed with / or ./ or ../deno(import-prefix-missing)
Hello! I literally just started a new project to learn Fresh and I got these issues, I wonder if anyone has any idea of what might be happening?
$ deno -V: deno 1.23.4
Installed via: curl -fsSL https://deno.land/install.sh | sh
macOS: Monterrey
settings.json
{
"deno.enable": true,
"deno.unstable": true
}
import_map.json
{
"imports": {
"$fresh/": "https://deno.land/x/fresh@1.0.1/",
"preact": "https://esm.sh/preact@10.8.2",
"preact/": "https://esm.sh/preact@10.8.2/",
"preact-render-to-string": "https://esm.sh/preact-render-to-string@5.2.0?deps=preact@10.8.2"
}
}
Using VsCode and https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno


About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 22 (2 by maintainers)
Ah, ok… hmmm… well, that would explain it all. 😄
settings.json
in a multi-root workspace doesn’t work in vscode because that tries to set it for the workspace folder, but we don’t allow that setting there, it needs to be set at the overall workspace level (which is what the IDE ensures works). This isn’t really a bug, though I can understand it is confusing, but if the auto-detection worked, we wouldn’t have been here!Closing because multi-root workspace support is an upstream Deno issue, and not specific to Fresh.
I’m having this same issue on newly created Fresh project using
deno run -A -r https://fresh.deno.dev my-project
.Ok, for some reason the Deno Language Server is not identifying the configuration and import map. In the logged output I would expected to see something like:
For troubleshooting purposes, could you try to things and see if the output changes:
deno.json
todeno.jsonc
and reloading (Developer: Reload Window from the command palette)"deno.config"
option to your workspace settings pointing to the config file and reloading