Relative path in `npm:` specifier
I have this in my import map:
And I try to do this:
The error.
Any ideas? Is it possible in the first place?
2 Replies
As far as I can tell, this syntax is only permissible to refer to NPM package binaries... What would be the appropriate way to accomplish the same thing in Deno?
Solved it. Apparently it's this syntax:
Cheerio
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with how the import map is handling the relative path in the
npm:
specifier.
The error message indicates that the after-prefix portion "24/outline" could not be URL-parsed relative to the URL prefix mapped to by "@heroicons/react/". This suggests that the import map may not be correctly resolving the relative path you're trying to use.
One thing you might want to check is whether the path you're using in your import statement correctly corresponds to the file structure within the @heroicons/react
package. If the file structure does not have a directory named "24" with a subdirectory "outline", then the path would not resolve correctly.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. It's also a good idea to consult the documentation or community resources for the @heroicons/react
package to ensure that you're using the correct file paths for importing the icons.