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.

Import map: unable to load a local module

See original GitHub issue

I have import-map.json at the root directory of my project with this content:

{
  "imports": {
    "/": "./",
    "./": "./"
  }
}

This is the contents of .vim/coc-settings.json:

{
  "deno.enable": true,
  "deno.importMap": "./import-map.json",
  "tsserver.enable": false
}

And in some given test file, I have this as the first line:

import { assertEquals } from "/deps.ts";

That line causes the following error:

Unable to load a local module: "file:///deps.ts".
  Please check the file path. (deno no-local)

I cannot do gf to that file, for instance, and get no types or documentation whatsoever for assertEquals.

Running deno test --import-map ./import-map.json src/foo.test.ts works.

Is this an issue with my config/setup perhaps, or could it be some other problem?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fannheywardcommented, Oct 10, 2022

Fixed in v3.10.2

1reaction
fannheywardcommented, Oct 10, 2022

Still working on this, maybe there’s something wrong on workspace configuration usage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client-side import map unable to locate module (error 404)
I'm attempting to import a module in vanilla JS in the browser (no bundler). The module is worker-timers ...
Read more >
Using ES modules in browsers with import-maps
In this post, we'll go through a few basic examples of how ES modules are used and then explore the possibility of using...
Read more >
How to Dynamically Import JavaScript with Import Maps
In this tutorial, you'll use import maps and JavaScript modules to import code without build tools. You'll create a basic application that ...
Read more >
Improve ease of use for import maps · Issue #3585 - GitHub
Not being able to use import maps in my reusable library modules has been annoying for me, too. One idea I came up...
Read more >
Everything You Need to Know About JavaScript Import Maps
Import maps are a new way for web pages to control the behavior of JavaScript imports, potentially enabling you to ditch your build...
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