Back

Can't use the client SDK on server for server side rendering

  • 0
  • Databases
  • Web
  • Cloud
nightwielder
19 Nov, 2023, 11:27

Good day! I am using Appwrite Cloud, and the web SDK version 13.0.0. I am trying to fetch some documents from a collection and it works fine. But when server side rendering is enabled, I get a weird error like this:

TypeScript
AppwriteException: request to https://cloud.appwrite.io/v1/databases/<>/collections/<>/documents?queries%5B1%5D=limit%2820%29&queries%5B2%5D=offset%280%29 failed, reason: 
    at Client.<anonymous> (file:///home/sh4jid/ronon/node_modules/appwrite/dist/esm/sdk.js:404:23)
    at Generator.throw (<anonymous>)
    at rejected (file:///home/sh4jid/ronon/node_modules/appwrite/dist/esm/sdk.js:23:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 0,
  type: '',
  response: ''

This error doesn't tell me anything. What can I do now?

I have another project with Appwrite 1.3.x, self hosted, where the same works perfectly.

UPDATE: Uhh... I don't know what to say, the error seems to have gone now. Can anyone explain what's up?

TL;DR
User is facing an error when using the client SDK for server side rendering with Appwrite Cloud. The error message received is not informative. Another project with self-hosted Appwrite 1.3.x works fine. The error eventually disappears on its own. Solution: No explicit solution provided.
D5
19 Nov, 2023, 13:32

Currently web SDK doesn't have full support for SSR

Drake
19 Nov, 2023, 14:20

Maybe there was an env variable not set correctly

nightwielder
19 Nov, 2023, 14:21

The issue did get fixed after some time, however.

Drake
19 Nov, 2023, 14:23

In some frameworks, people update the .env file, but live reload won't apply the env var change. Only restarting the dev server does. So maybe that's what happened to you

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more