appwrite / sdk-for-node

[READ-ONLY] Official Appwrite Node.js SDK 🟒

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸš€ Feature: Add support for Cloudflare Pages

shyakadavis opened this issue Β· comments

πŸ”– Feature description

Hello;

Thanks again for Appwrite; really neat project, with awesome docs too.

So, after introducing SSR capabilities, I was finally getting started on my SvelteKit project, and followed along with how this sdk is the one to use for SSR.

Currently, deploying my project to Cloudflare Pages breaks everything since CF isn't a true node runtime, and doesn't support some modules. I know from the name itself this is a node sdk, but I was hoping to hear of a solution and/or alternatives in order to have SSR in my app.

There are currently Error: Bundling with esbuild failed with 29 errors in different files that crash everything. Here is a list of inaccessible modules and file source:

  • os (File: node-appwrite/lib/client.js)
  • url (File: node-appwrite/lib/client.js)
  • fs (File: node-appwrite/lib/inputFile.js)
  • fs (File: node-appwrite/lib/services/account.js)
  • fs (File: node-appwrite/lib/services/avatars.js)
  • fs (File: node-appwrite/lib/services/databases.js)
  • fs (File: node-appwrite/lib/services/functions.js)
  • fs (File: node-appwrite/lib/services/graphql.js)
  • fs (File: node-appwrite/lib/services/health.js)
  • fs (File: node-appwrite/lib/services/locale.js)
  • fs (File: node-appwrite/lib/services/messaging.js)
  • fs (File: node-appwrite/lib/services/storage.js)
  • fs (File: node-appwrite/lib/services/teams.js)
  • fs (File: node-appwrite/lib/services/users.js)
  • net (File: undici/lib/client.js)
  • http (File: undici/lib/client.js)
  • net (File: undici/lib/core/connect.js)
  • tls (File: undici/lib/core/connect.js)
  • http (File: undici/lib/core/util.js)
  • net (File: undici/lib/core/util.js)
  • querystring (File: undici/lib/core/util.js)
  • worker_threads (File: undici/lib/fetch/constants.js)
  • zlib (File: undici/lib/fetch/index.js)
  • http (File: undici/lib/fetch/index.js)
  • perf_hooks (File: undici/lib/fetch/util.js)
  • http (File: undici/lib/mock/mock-utils.js)
  • console (File: undici/lib/mock/pending-interceptors-formatter.js)
  • url (File: undici/lib/proxy-agent.js)
  • worker_threads (File: undici/lib/websocket/events.js)

I guess my ask is, do you mind providing support for Cloudflare pages with this SDK, and if it's not possible, do you mind pointing me in the right direction in terms of alternatives for someone trying to use SSR capabilities with Appwrite but deploying on Cloudflare.

Thank you for the consideration. πŸ™‚

🎀 Pitch

In my use-case, I really love deploying to Cloudflare because it's very convenient, easy, and free. πŸ™‚

Guessing other people feel the same.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏒 Have you read the Code of Conduct?

Thank you.

I'll leave this open as we wait for the P.R to land, but please feel free to close if it's not necessary.

commented

Thanks for submitting @shyakadavis.

Assigning this to @loks0n - once appwrite/sdk-generator#799 is merged we should be good to close.

I wanted to try this out in my sveltekit project and get this error when using the rc.4:

image

Looking into the index.mjs file, it seems like every import is without a .mjs extension so that it doesn't get resolved.
Adding these file extensions manually fixes the issue.
Is this a tsconfig/package.json/vite config error, so that the wrong file gets looked up, or do those .mjs extensions have to be added?

Hello, @stnguyen90, @loks0n (sorry for the pings)

Wanted to report the same issue as @eweren. It's currently blocking. πŸ™ƒ

@eweren, @shyakadavis, let me check with the team.

Closing since appwrite/sdk-generator#799 is complete.