How to import `deno.json`/`jsr` based module directly from github?
I have a fork of a project that uses
deno.json
/jsr
scheme at https://github.com/Yohe-Am/dax/.
And I want to import and use my fork as...
But this ends up breaking due to the deno.json
backed imports the code uses (see attached image).
I don't want to have to publish my fork on JSR to be able to use it. Is this a bug? Am I missing something?GitHub
GitHub - Yohe-Am/dax: Cross platform shell tools for Deno inspired ...
Cross platform shell tools for Deno inspired by zx. - Yohe-Am/dax
1 Reply
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, there might be an issue with importing modules directly from a GitHub raw content URL.
When you import a module from a raw GitHub URL, it doesn't process the
deno.json
configuration file that might be present in the repository. This means that any import maps or configuration specified in deno.json
won't be applied, which could lead to broken imports if the code relies on them.
One potential solution is to ensure that all imports in your fork are fully qualified URLs that don't rely on import maps or other deno.json
configurations. This way, the code can be imported directly without needing the deno.json
to resolve any module paths.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. If you continue to experience issues, you might want to consider reaching out to the Deno community for further assistance or looking into whether there are alternative ways to reference your fork without relying on raw GitHub URLs.