Relative import path "preact" not prefixed with / or ./ or ../deno(import-prefix-missing)
See original GitHub issueHello! 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
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:17 (1 by maintainers)
Top Results From Across the Web
0 - Stack Overflow
error: Relative import path "reflect-metadata" not prefixed with / or ... I'm trying to start making discord bots with Deno and TypeScript.
Read more >Import Maps | Manual - Deno
import { MyUtil } from "/util. ts"; This causes import specifiers starting with / to be resolved relative to the import map's URL...
Read more >r/Deno - Reddit
ImportPrefixMissing : relative import path "runner.ts" not prefixed with ... I've checked the repo(s) and all imports are prefixed with .
Read more >Building React Applications using Deno: The Definite Guide
Import statements for react and framework/react give linting error relative import path "react" not prefixed with / or ./ or ../ . JSX...
Read more >rollup.js
Importing CommonJS · Publishing ES Modules ... does not start with rollup-plugin- or @rollup/plugin- , Rollup will automatically try adding these prefixes:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!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