skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

[Package Error] \"fs\" does not exist. #182

Open TillaTheHun0 opened 3 years ago

TillaTheHun0 commented 3 years ago

Thanks for you all's work on Skypack. It's been a boon for our Deno projects.

 deno run --unstable  https://cdn.skypack.dev/minio

Produces the error.

error: Uncaught Error: [Package Error] "fs" does not exist. (Imported by "minio").
throw new Error("[Package Error] \"fs\" does not exist. (Imported by \"minio\").");
      ^
    at https://cdn.skypack.dev/error/node:fs?from=minio:14:7

From this post I thought fs would be polyfilled with deno's fs node compatibility module here

Perhaps I am missing something?

edit: added full error message

TillaTheHun0 commented 3 years ago

Weird thing is that I do see Deno's fs compatibility module being pulled down:

...
Download https://deno.land/std@0.98.0/node/fs.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_access.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_copy.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_fstat.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_ftruncate.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_futimes.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_mkdtemp.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_rename.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_exists.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_fdatasync.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_readlink.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_stat.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_symlink.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_appendFile.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_link.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_mkdir.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_readdir.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_fsync.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_realpath.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_lstat.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_writeFile.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_close.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_open.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_readFile.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_chown.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_truncate.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_dir.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_chmod.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_rmdir.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_constants.ts
Download https://deno.land/std@0.98.0/node/_fs/promises/mod.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_unlink.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_utimes.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_dirent.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_watch.ts
Download https://deno.land/std@0.98.0/node/_utils.ts
Download https://deno.land/std@0.98.0/node/buffer.ts
Download https://deno.land/std@0.98.0/node/_fs/_fs_common.ts
Download https://deno.land/std@0.98.0/node/path.ts
Download https://deno.land/std@0.98.0/node/_errors.ts
...
EmreErdogan commented 2 years ago

According to Skypack docs Skypack cannot polypill fs module.

A Note on Node.js Compatability

Skypack automatically converts legacy npm packages to modern ESM and polyfills some common Node.js built-in modules that they might depend on.

However, some modules (like the "fs" file system API) cannot be polyfilled and thus can't run on Deno (or anywhere outside of Node.js). Any packages on npm that rely on these dependencies won't run on Deno.

  • fs
  • crypto
  • http
  • https