Back

Issues withs Nextjs and Appwrite Client.subscribe() method using appwrite-sdk

  • 0
  • Self Hosted
  • Web
  • Realtime
bside-dev
16 Jan, 2024, 16:24

I'm attempting to setup a realtime chat component in my nextjs app, but I'm getting module not found errors when using the .subscribe() function on the client-side of the application. I'm getting the following error from node:

TypeScript
⨯ ./node_modules/node-appwrite/lib/inputFile.js:2:0
Module not found: Can't resolve 'fs'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/node-appwrite/index.js
./src/config/appwrite.ts
./src/pages/account/support-chat.tsx

When looking and documentation and tutorials, it looks like things are being done on the client-side so I'm not sure why I would be getting this error from the appwrite sdk. i'm using appwrite version 1.1.1 (planning an upgrade to 1.4 very soon) self-hosted

TL;DR
I'm having module not found errors when using the .subscribe() function in Nextjs with the appwrite-sdk. The error message mentions 'fs' module not found. I've checked the documentation and tutorials, but it should be happening on the client-side. I'm using appwrite version 1.1.1. Solution: Upgrade to appwrite version 1.4.
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