smbkr
smbkr11mo ago

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

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.
1 Reply
bartlomieju
bartlomieju11mo ago
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