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

Failed to import -

Open kyleconroy opened this issue 10 months ago • 4 comments
trafficstars

Failing module

  • npm: https://npmjs.com/package/jsdom
$ deno cache https://esm.sh/[email protected]

Error message

After running deno cache I got this:

error: Module not found "https://esm.sh/build/Release/canvas.node?target=denonext".
    at https://esm.sh/[email protected]?target=denonext:2:8

Additional info

  • Deno version: v1.41.3

kyleconroy avatar Jan 15 '25 21:01 kyleconroy

Hello. We have a similar problem since version 136. We are using deno 2.1.4 and 2.1.5

We are importing https://esm.sh/@actions/[email protected], which imports the undici package. This leads to import of "/node:sqlite?target=denonext";, but no such module exists.

https://esm.sh/[email protected]?target=denonext

/* esm.sh - [email protected] */
import "/node:sqlite?target=denonext";
export * from "/[email protected]/denonext/undici.mjs";
export { default } from "/[email protected]/denonext/undici.mjs";

I'm not sure whether the node: prefix is expected. The server correctly resolves htttps://esm.sh/sqlite?target=denonext (without the prefix).

Using https://esm.sh/v135/@actions/[email protected] resolves all dependencies correctly.

vbookie avatar Jan 16 '25 11:01 vbookie

We ended up downgrading to v135 to solve this issue. It looks like the issue is that removal of build support in v136

kyleconroy avatar Jan 16 '25 14:01 kyleconroy

Seeing a similar thing with linkedom, thanks for downgrade tip

This works: deno cache https://esm.sh/v135/[email protected] This doesn't: deno cache https://esm.sh/v136/[email protected]

Hopefully whatever magic "build" was doing before can be resurrected in a new form?

johnspurlock avatar Jan 24 '25 23:01 johnspurlock

It seems to be a similar problem.

// main.ts
import { Canvas } from 'https://esm.sh/[email protected]';
console.log(Canvas);
% deno --version      
deno 2.2.12 (stable, release, aarch64-apple-darwin)
v8 13.5.212.10-rusty
typescript 5.7.3
% deno run main.ts    
error: Module not found "https://esm.sh/[email protected]/Release/canvas.node?target=denonext".
    at https://esm.sh/[email protected]:2:8

Hajime-san avatar Apr 29 '25 13:04 Hajime-san