D
Deno

help

Importing NPM packages with `npm:` where package has `@` in the name

Ssmbkr9/5/2023
I want to import the package @hono/zod-openapi, version 0.30 I tried to add to my deno.json like so:
{
"imports": {
"@hono/zod-openapi": "npm:@hono/zod-openapi@0.3.0",
}
}
{
"imports": {
"@hono/zod-openapi": "npm:@hono/zod-openapi@0.3.0",
}
}
but it doesn't work:
error: Could not resolve 'npm:@hono/zod-openapi@0.3.0'.

Caused by:
not found
error: Could not resolve 'npm:@hono/zod-openapi@0.3.0'.

Caused by:
not found
I also tried: removing the leading @ and tried @hono@0.3.0/zod-openapi but those don't work either.
Bbartlomieju9/6/2023
Seems like a bug. Can you open an issue about it in the Deno repo? Scoped packages are definitely supported, it might be a problem with an import map implementation

Looking for more? Join the community!