Skip to content

import.resolve doesnt work with npm: specfiers when run with node in a jsr package #1187

@sigmaSd

Description

@sigmaSd

Version: deno 2.4.5+41ff38a (canary, release, x86_64-unknown-linux-gnu)

I have this issue with node that I'm curious if it can be improved

running npx @modelcontextprotocol/inspector@0.16.6 deno -R jsr:@sigmasd/pdf-read-mcp@1.2.1
and using read_pdf tool to read a pdf works correctly

running npx @modelcontextprotocol/inspector@0.16.6 npx xjsr @sigmasd/pdf-read-mcp@1.2.1 i can use the tool read_pdf but it errors with

Error reading PDF: Error: Setting up fake worker failed: "Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'npm:'".

I see that the published version have npm: added to it https://jsr.io/@sigmasd/pdf-read-mcp/1.2.1/server.ts#L22
but maybe things can be better ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions