esm-dev / esm.sh

The no-build CDN for modern web development.
https://esm.sh
MIT License
3.15k stars 151 forks source link

Failed to import - ipfs-core #355

Open legowerewolf opened 2 years ago

legowerewolf commented 2 years ago

Failing module

import * as IPFS from "https://esm.sh/ipfs-core@0.15.4";

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/std@0.143.0/node/util/types.ts".
    at https://esm.sh/v86/undici@5.5.1/deno/undici.js:2:1078

Additional info

ije commented 2 years ago

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

legowerewolf commented 2 years ago

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/std@0.143.0/node/diagnostics_channel.ts".
    at https://esm.sh/v86/undici@5.5.1/deno/undici.js:2:852
error: Module not found "https://deno.land/std@0.143.0/node/util/types.ts".
    at https://esm.sh/v86/undici@5.5.1/deno/undici.js:2:1078