Since Deno 2.6.6 getting "Too many redirects for 'npm:/..." errors

#171 · open · 3 comments

View on GitHub ↗

zefhemel

With Deno 2.6.5 all is fine, after upgrading to 2.6.6 I get this: ``` ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/sql' [plugin deno-loader] client/languages.ts:5:7: 5 │ } from "@codemirror/legacy-modes/mode/sql"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/rust' [plugin deno-loader] client/languages.ts:6:37: 6 │ import { rust as rustLanguage } from "@codemirror/legacy-modes/mode/rust"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/python' [plugin deno-loader] client/languages.ts:7:41: 7 │ import { python as pythonLanguage } from "@codemirror/legacy-modes/mode/python"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/protobuf' [plugin deno-loader] client/languages.ts:10:7: 10 │ } from "@codemirror/legacy-modes/mode/protobuf"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/shell' [plugin deno-loader] client/languages.ts:11:39: 11 │ import { shell as shellLanguage } from "@codemirror/legacy-modes/mode/shell"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ✘ [ERROR] Too many redirects for 'npm:/@codemirror/[email protected]/mode/swift' [plugin deno-loader] client/languages.ts:12:39: 12 │ import { swift as swiftLanguage } from "@codemirror/legacy-modes/mode/swift"; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` (examples here are all about codemirror, but I have other examples too with preact/hooks imports for instance) This seems to only happen for npm imports that have paths inside of a package, in my `deno.json` I have import maps like this:: ``` "imports": { "@codemirror/legacy-modes": "npm:@codemirror/[email protected]" } ``` Any idea what could be going on?

Comments

egfx-notifications

I bisected the changes between Deno 2.6.5 and 2.6.6, it seems to be caused by this upgrade of `deno_graph`: https://github.com/denoland/deno/pull/31879

egfx-notifications

https://github.com/denoland/deno/pull/31879/changes#diff-173ccedeb7f83e3e957f25e701e7fd898850183300d22f07698f9b37d7bdbbd5R347-R357 generates circular redirects I have a fix that works for my affected project. Will make a PR in the deno project after testing this more thoroughly.

dsherret

My bad! Side note: I recommend using https://github.com/denoland/deno-esbuild-plugin if that's possible in your situation as it's up to date with the latest Deno.