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

Cloudflare Workers/Pages adapter doesn't work with Flydrive #13005

Open
svelterust opened this issue Nov 15, 2024 · 2 comments
Open

Cloudflare Workers/Pages adapter doesn't work with Flydrive #13005

svelterust opened this issue Nov 15, 2024 · 2 comments

Comments

@svelterust
Copy link

Describe the bug

I'm trying to use Flydrive with SvelteKit using the any of the Cloudflare adapters but none of them work. The same imports work with Hono, so I'm guessing there's something going on here.

My goal is to use local filesystem while developing, then in production use S3 so that it works with Cloudflare Pages.

Reproduction

https://github.com/svelterust/flydrive-pages

bun install
bun run build

Logs

> 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.


### System Info

```Shell
~ ❯ bunx envinfo --system --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"

  System:
    OS: Linux 6.6 NixOS 24.11 (Vicuna) 24.11 (Vicuna)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
    Memory: 9.42 GB / 15.43 GB
    Container: Yes
    Shell: 5.2.32 - /run/current-system/sw/bin/bash
  Binaries:
    Node: 22.9.0 - ~/.nix-profile/bin/node
    Yarn: 1.22.22 - ~/.nix-profile/bin/yarn
    npm: 10.8.3 - ~/.nix-profile/bin/npm
    bun: 1.1.31 - ~/.nix-profile/bin/bun


### Severity

annoyance

### Additional Information

_No response_
@svelterust
Copy link
Author

I've tried to enable node_compat in wrangler.toml on previous projects, but it doesn't seem to affect the Vite build.

@eltigerchino
Copy link
Member

I'm unable to reproduce the issue after downloading the repository, installing, and building it. Please provide another minimal reproduction.

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

No branches or pull requests

2 participants