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

Make it work on Cloudflare Pages/Workers #7

Open
svelterust opened this issue Nov 15, 2024 · 1 comment
Open

Make it work on Cloudflare Pages/Workers #7

svelterust opened this issue Nov 15, 2024 · 1 comment

Comments

@svelterust
Copy link

Ideally, I should be able to use this library with dynamic import so that I can use S3 on Cloudflare Pages/Workers and filesystem locally. But currently when trying to import the core library, it fails because it uses some dependencies that don't work there.

@svelterust
Copy link
Author

svelterust commented Nov 15, 2024

Seems to be an issue with SvelteKit I think, created a repository here: https://github.com/svelterust/flydrive-pages. Just run with bun install then bun run build. Getting these issues here:

> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "node:url"

    node_modules/@poppinss/utils/build/index.js:21:48:
      21 │ import { fileURLToPath as fileURLToPath3 } from "node:url";
         ╵                                                 ~~~~~~~~~~

  Cannot use "node:url" when deploying to Cloudflare.


✘ [ERROR] Could not resolve "node:fs/promises"

    node_modules/@poppinss/utils/build/index.js:122:30:
      122 │ import { readdir, stat } from "node:fs/promises";
          ╵                               ~~~~~~~~~~~~~~~~~~

  Cannot use "node:fs/promises" when deploying to Cloudflare.


✘ [ERROR] Could not resolve "fs"

    node_modules/etag/index.js:22:20:
      22 │ var Stats = require('fs').Stats
         ╵                     ~~~~

  Cannot use "fs" when deploying to Cloudflare.

Same imports worked with Hono however, not sure what's happening here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant