question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relative import path "preact" not prefixed with / or ./ or ../deno(import-prefix-missing)

See original GitHub issue

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

image

image image

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
kitsonkcommented, Aug 2, 2022

Ah, ok… hmmm… well, that would explain it all. 😄

  • Auto-detection of a config file doesn’t work in multi-root workspaces. This is a bug and I will raise an issue about it.
  • Setting the option in 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!
1reaction
kitsonkcommented, Jul 25, 2022

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:

Starting Deno language server...
  version: 1.23.4 (release, x86_64-apple-darwin)
  executable: /Users/xxx/.deno/bin/deno
Connected to "Visual Studio Code" 1.69.2
  Auto-resolved configuration file: "file:///Users/xxx/deno.json"
Setting import map from configuration file: "./import-map.json"
  Resolved import map: "/Users/xxx/import-map.json"

For troubleshooting purposes, could you try to things and see if the output changes:

  • renaming the deno.json to deno.jsonc and reloading (Developer: Reload Window from the command palette)
  • adding "deno.config" option to your workspace settings pointing to the config file and reloading
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found