esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

error using path=/ in importmap

Open smcardle opened this issue 1 year ago • 3 comments

I have the following error in the console when trying to import webSocker from rxjs.

Failed to resolve module specifier "rxjs/webSocket". Import Map: "rxjs/webSocket" matches with "rxjs/" but is blocked due to backtracking

My rxjs importmap values are as follows -

          "rxjs": "https://esm.sh/[email protected]?pin=v89",
          "rxjs/": "https://esm.sh/[email protected]?pin=v89&path=/",
          "rxjs/operators": "https://esm.sh/[email protected]/operators?external=rxjs&pin=v89",

And the code causing the error is as follows -

      import {webSocket} from 'rxjs/webSocket'
      const subject$ = webSocket('wss://app.<domain>.com');

Does anybody know why I am getting the backtracking error ??

Steve

smcardle avatar Aug 03 '22 05:08 smcardle

the error happened since deno import map resolver doesn't support ?path=/, try the esm.sh CLI mode i'm working on it: deno run -A -r https://esm.sh add rxjs

ije avatar Aug 03 '22 10:08 ije

I'm not using Deno.

The importmap is in the browser head section and has nothing to do with Deno

smcardle avatar Aug 03 '22 20:08 smcardle

or you can use https://esm.sh/v89/[email protected]/ instead of https://esm.sh/[email protected]?pin=v89&path=/

ije avatar Aug 04 '22 10:08 ije