π 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?
- I have read the Code of Conduct
Update: we have a pending PR with a fix for this here: appwrite/sdk-generator#799
https://www.npmjs.com/package/node-appwrite/v/12.1.0-rc.4 is now available.
Closing as a duplicate of #53