appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧑

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Bug Report: Node dependencies prevent SSR (like Remix) on Cloudflare Pages

jgentes opened this issue Β· comments

πŸ‘Ÿ Reproduction steps

Using https://github.com/Meldiron/appwrite-ssr-remix from @Meldiron, replace @remix-run/node with @remix-run/cloudflare.

The workaround (for Node) is to use installGlobals as seen in https://github.com/Meldiron/appwrite-ssr-remix/blob/main/server.ts, however this is not available for Cloudflare as Workers use the V8 runtime.

πŸ‘ Expected behavior

The client should not use isomorphic libraries, and instead determine which libraries to use based on the platform. <-- guessing here

πŸ‘Ž Actual Behavior

Using import { Client } from 'appwrite' in a server file will cause Uncaught ReferenceError: window is not defined due to the use of node_modules/isomorphic-form-data/lib/browser.js which does not work on edge (Workers). Pages is built on Workers, so it prevents deployment.

🎲 Appwrite version

Version 0.10.x

πŸ’» Operating system

Linux

🧱 Your Environment

No response

πŸ‘€ 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?

Update: we have a pending PR with a fix for this here: appwrite/sdk-generator#799

Closing as a duplicate of #53