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

Failed to import - ipfs-core

Open legowerewolf opened this issue 3 years ago • 2 comments

Failing module

  • GitHub: https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-core
  • npm: ipfs-core
import * as IPFS from "https://esm.sh/[email protected]";

const node = await IPFS.create();

const stream = node.cat("QmPChd2hVbrJ6bfo3WBcTW4iZnpHm8TEzWkLHmLpXhF68A");
const decoder = new TextDecoder();
let data = "";

for await (const chunk of stream) {
	// chunks of data are returned as a Uint8Array, convert it back to a string
	data += decoder.decode(chunk, { stream: true });
}

console.log(data); // should output "Hello, <YOUR NAME HERE>"

Error message

After running deno run I got this:

error: Module not found "https://deno.land/[email protected]/node/util/types.ts".
    at https://esm.sh/v86/[email protected]/deno/undici.js:2:1078

Additional info

  • esm.sh version: v86
  • Deno version:
    deno 1.23.1 (release, x86_64-pc-windows-msvc)
    v8 10.4.132.8
    typescript 4.7.2
    

legowerewolf avatar Jun 29 '22 02:06 legowerewolf

seems it's types bug, you can disable the types by ?no-check query, i will look into it

ije avatar Jun 29 '22 13:06 ije

Still doesn't work, even with the ?no-check query. When I try repeatedly, I get the following on various tries:

error: Module not found "https://deno.land/[email protected]/node/diagnostics_channel.ts".
    at https://esm.sh/v86/[email protected]/deno/undici.js:2:852
error: Module not found "https://deno.land/[email protected]/node/util/types.ts".
    at https://esm.sh/v86/[email protected]/deno/undici.js:2:1078

legowerewolf avatar Jun 29 '22 18:06 legowerewolf