Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdn.jsdelivr.net can time out on some modules, triggering an uncaught error #1352

Closed
Fil opened this issue May 15, 2024 · 2 comments
Closed
Labels
question Further information is requested

Comments

@Fil
Copy link
Contributor

Fil commented May 15, 2024

With a page that contains:

```js echo
const Cite = import("npm:citation-js");
```

loading the modules ends up in a breaking timeout (showing "fetch failed" on the page) on https://cdn.jsdelivr.net/npm/@citation-js/plugin-wikidata@0.7.11/+esm (which also fails if you try to open it independently of framework). In the log we see:

npm:@citation-js/plugin-wikidata@0.7.11/+esm → src/.observablehq/cache/_npm/@citation-js/plugin-wikidata@0.7.11/_esm.js
TypeError: fetch failed
    at node:internal/deps/undici/undici:12442:11
    …

I initially thought this was a fluke, but trying to install the same module locally (yarn add citation-js) I see this warning:

warning citation-js > @citation-js/plugin-wikidata > wikidata-sdk@8.1.1: wikidata-sdk has been renamed wikibase-sdk

which might be the root cause.

Should our npm: resolver do some work to detect a rename? Should we catch this error? Should we just leave this as is? — it seems possible to load citation-js with: import("npm:@citation-js/core");

@Fil Fil added the question Further information is requested label May 15, 2024
@mbostock
Copy link
Member

Should our npm: resolver do some work to detect a rename?

No, what you saw is a deprecation warning. There isn’t a formal concept of a rename and it wouldn’t be safe or reliable to try to parse deprecation warnings for renames.

@mbostock
Copy link
Member

Don’t think there’s anything we can do here.

@mbostock mbostock closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants